Browse Source

Fix bugs found in testing

Giulio 2 years ago
parent
commit
0b476df8b5
2 changed files with 6 additions and 6 deletions
  1. 1 1
      qubesadmin/firewall.py
  2. 5 5
      qubesadmin/tools/qvm_firewall.py

+ 1 - 1
qubesadmin/firewall.py

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

+ 5 - 5
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