109 return output
110 return http_context.fallthrough(self.invalid)
111
112 def respond_error(self, http_context, exception):113 http_context.respond_server_error()
114 stack = traceback.format_exc()
115 traceback.print_exc()
205 raise SudoError((o + e).decode('utf-8').splitlines()[-1].strip())
206 return True
207
208 def client_certificate_callback(self, connection, x509, errno, depth, result):209 if depth == 0 and (errno == 9 or errno == 10):
210 return False # expired / not yet valid
211 if not aj.config.data['ssl']['client_auth']['force']:
205 raise SudoError((o + e).decode('utf-8').splitlines()[-1].strip())
206 return True
207
208 def client_certificate_callback(self, connection, x509, errno, depth, result):209 if depth == 0 and (errno == 9 or errno == 10):
210 return False # expired / not yet valid
211 if not aj.config.data['ssl']['client_auth']['force']:
23
24 @get(r'/api/iptables')
25 @endpoint(api=True)
26 def handle_api_get_iptables(self, http_context):27 try:
28 chains_list = subprocess.check_output(f"{self.iptables} -L -n --line-numbers".split()).decode()
29 except Exception as e:
15
16 @get(r'/api/iptables/which')
17 @endpoint(api=True)
18 def handle_api_get_which_iptables(self, http_context):19 try:
20 self.iptables = subprocess.check_output(['which', 'iptables']).decode().strip()
21 except subprocess.CalledProcessError as e:
An unused argument can lead to confusions. It should be removed. If this variable is necessary, name the variable _
or start the name with unused
or _unused
.
def square(x, y=1):
return x * x
class MySubClass(MyClass):
def __init__(self, number):
self.value = 42 # argument `number` remains unused
def square(x):
return x * x
class MySubClass(MyClass):
def __init__(self, _):
self.value = 42