From 0b476df8b522255f97232526c766066c3458c35d Mon Sep 17 00:00:00 2001 From: Giulio Date: Fri, 25 Jun 2021 02:05:54 +0200 Subject: [PATCH] Fix bugs found in testing --- qubesadmin/firewall.py | 2 +- qubesadmin/tools/qvm_firewall.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qubesadmin/firewall.py b/qubesadmin/firewall.py index 858b625..ad6014b 100644 --- a/qubesadmin/firewall.py +++ b/qubesadmin/firewall.py @@ -74,7 +74,7 @@ class Action(RuleChoice): return 'action=' + str(self) -class ForwardType(RuleOption): +class ForwardType(RuleChoice): external = 'external' internal = 'internal' diff --git a/qubesadmin/tools/qvm_firewall.py b/qubesadmin/tools/qvm_firewall.py index 2669ac5..c6b59d9 100644 --- a/qubesadmin/tools/qvm_firewall.py +++ b/qubesadmin/tools/qvm_firewall.py @@ -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