Another approach for making qvm-shutdown nice for tests
This commit is contained in:
parent
5944de1eed
commit
bc9fd47aa0
@ -36,7 +36,7 @@ def interrupt_on_vm_shutdown(vms, subject, event):
|
|||||||
'''Interrupt events processing when given VM was shutdown'''
|
'''Interrupt events processing when given VM was shutdown'''
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
if event == 'connection-established':
|
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
|
raise Interrupt
|
||||||
elif event == 'domain-shutdown' and subject in vms:
|
elif event == 'domain-shutdown' and subject in vms:
|
||||||
vms.remove(subject)
|
vms.remove(subject)
|
||||||
|
@ -83,7 +83,7 @@ def main(args=None, app=None): # pylint: disable=missing-docstring
|
|||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
loop.run_until_complete(asyncio.wait_for(
|
loop.run_until_complete(asyncio.wait_for(
|
||||||
qubesadmin.events.utils.wait_for_domain_shutdown(
|
qubesadmin.events.utils.wait_for_domain_shutdown(
|
||||||
sorted(this_round_domains)),
|
this_round_domains),
|
||||||
args.timeout))
|
args.timeout))
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
for vm in this_round_domains:
|
for vm in this_round_domains:
|
||||||
|
Loading…
Reference in New Issue
Block a user