tools: don't fail qvm-template-postprocess on shutdown race condition

It may happen that shutdown timeout expires at exact time that template
has stopped.
This commit is contained in:
Marek Marczykowski-Górecki 2018-06-27 01:29:20 +02:00
parent 0caf6f735d
commit b359f9ca5e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -185,7 +185,10 @@ def call_postinstall_service(vm):
yield from asyncio.sleep(1)
timeout -= 1
if not vm.is_halted():
vm.kill()
try:
vm.kill()
except qubesadmin.exc.QubesVMNotStartedError:
pass
finally:
vm.netvm = qubesadmin.DEFAULT