Fix bugs found in testing

This commit is contained in:
Giulio 2021-06-25 02:05:54 +02:00
parent 0256ec981d
commit 0b476df8b5
2 changed files with 6 additions and 6 deletions

View File

@ -74,7 +74,7 @@ class Action(RuleChoice):
return 'action=' + str(self)
class ForwardType(RuleOption):
class ForwardType(RuleChoice):
external = 'external'
internal = 'internal'

View File

@ -148,8 +148,8 @@ def rules_list_table(vm):
:param vm: VM object
:return: None
'''
header = ['NO', 'ACTION', 'FORWARD TYPE', 'HOST', 'PROTOCOL', 'SRCPORT', 'PORT(S)',
'SPECIAL TARGET', 'ICMP TYPE', 'EXPIRE', 'COMMENT']
header = ['NO', 'ACTION', 'FORWARD TYPE', 'HOST', 'PROTOCOL', 'SRCPORT(s)',
'PORT(S)', 'SPECIAL TARGET', 'ICMP TYPE', 'EXPIRE', 'COMMENT']
rows = []
for (rule, rule_no) in zip(vm.firewall.rules, itertools.count()):
row = [x.pretty_value if x is not None else '-' for x in [
@ -157,12 +157,12 @@ def rules_list_table(vm):
rule.forwardtype,
rule.dsthost,
rule.proto,
rule.dstports,
rule.srcports,
rule.dstports,
rule.specialtarget,
rule.icmptype,
rule.expire,
rule.comment,
rule.comment
]]
rows.append([str(rule_no)] + row)
qubesadmin.tools.print_table([header] + rows)
@ -216,7 +216,7 @@ def main(args=None, app=None):
rules_list_table(vm)
if args.reload:
vm.firewall.reload()
except qubesadmin.exc.QubesException as e:""
except qubesadmin.exc.QubesException as e:
parser.print_error(str(e))
return 1
return 0