From bc9fd47aa01fe5230ec5cbe96ba0a24d14c98ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 10 Dec 2017 22:52:29 +0100 Subject: [PATCH] Another approach for making qvm-shutdown nice for tests --- qubesadmin/events/utils.py | 2 +- qubesadmin/tools/qvm_shutdown.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qubesadmin/events/utils.py b/qubesadmin/events/utils.py index f9118b3..c6c8e4d 100644 --- a/qubesadmin/events/utils.py +++ b/qubesadmin/events/utils.py @@ -36,7 +36,7 @@ def interrupt_on_vm_shutdown(vms, subject, event): '''Interrupt events processing when given VM was shutdown''' # pylint: disable=unused-argument if event == 'connection-established': - if all(vm.is_halted() for vm in vms): + if all(vm.is_halted() for vm in sorted(vms)): raise Interrupt elif event == 'domain-shutdown' and subject in vms: vms.remove(subject) diff --git a/qubesadmin/tools/qvm_shutdown.py b/qubesadmin/tools/qvm_shutdown.py index be1dc22..48687a3 100644 --- a/qubesadmin/tools/qvm_shutdown.py +++ b/qubesadmin/tools/qvm_shutdown.py @@ -83,7 +83,7 @@ def main(args=None, app=None): # pylint: disable=missing-docstring # pylint: disable=no-member loop.run_until_complete(asyncio.wait_for( qubesadmin.events.utils.wait_for_domain_shutdown( - sorted(this_round_domains)), + this_round_domains), args.timeout)) except asyncio.TimeoutError: for vm in this_round_domains: