Browse Source

Another approach for making qvm-shutdown nice for tests

Marek Marczykowski-Górecki 6 years ago
parent
commit
bc9fd47aa0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      qubesadmin/events/utils.py
  2. 1 1
      qubesadmin/tools/qvm_shutdown.py

+ 1 - 1
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)

+ 1 - 1
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: