From ab79bd2a4490f21a3299dfdf34527474b0ea2a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 30 Apr 2018 04:16:23 +0200 Subject: [PATCH] tools/qvm-firewall: make 'list' a default action --- qubesadmin/tests/tools/qvm_firewall.py | 4 ++-- qubesadmin/tools/qvm_firewall.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qubesadmin/tests/tools/qvm_firewall.py b/qubesadmin/tests/tools/qvm_firewall.py index a5cc957..24145c9 100644 --- a/qubesadmin/tests/tools/qvm_firewall.py +++ b/qubesadmin/tests/tools/qvm_firewall.py @@ -110,7 +110,7 @@ class TC_10_qvm_firewall(qubesadmin.tests.QubesTestCase): ' - -', ]) - def test_001_list(self): + def test_001_list_default(self): self.app.expected_calls[('test-vm', 'admin.vm.firewall.Get', None, None)] = \ b'0\0action=accept dsthost=qubes-os.org proto=tcp ' \ @@ -118,7 +118,7 @@ class TC_10_qvm_firewall(qubesadmin.tests.QubesTestCase): b'action=drop proto=icmp icmptype=8\n' \ b'action=accept specialtarget=dns comment=Allow DNS\n' with qubesadmin.tests.tools.StdoutBuffer() as stdout: - qubesadmin.tools.qvm_firewall.main(['test-vm', 'list'], app=self.app) + qubesadmin.tools.qvm_firewall.main(['test-vm'], app=self.app) self.assertEqual( [l.strip() for l in stdout.getvalue().splitlines()], ['NO ACTION HOST PROTOCOL PORT(S) SPECIAL ' diff --git a/qubesadmin/tools/qvm_firewall.py b/qubesadmin/tools/qvm_firewall.py index e17eb5e..fbb92cd 100644 --- a/qubesadmin/tools/qvm_firewall.py +++ b/qubesadmin/tools/qvm_firewall.py @@ -189,7 +189,7 @@ def main(args=None, app=None): rules_add(vm, args) elif args.command == 'del': rules_del(vm, args) - elif args.command == 'list': + else: if args.raw: rules_list_raw(vm) else: