tools/qvm-run: fix error reporting on qvm-run -n on halted qube

Fixes QubesOS/qubes-issues#4476
This commit is contained in:
Marek Marczykowski-Górecki 2018-12-07 04:53:57 +01:00
parent d34b1bfc4f
commit 4b00ef7ec7
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 5 additions and 1 deletions

View File

@ -479,7 +479,7 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
ret = qubesadmin.tools.qvm_run.main(
['--no-gui', '--no-autostart', 'test-vm3', 'command'],
app=self.app)
self.assertEqual(ret, 0)
self.assertEqual(ret, 1)
self.assertEqual(self.app.service_calls, [])
self.assertAllCalled()

View File

@ -207,6 +207,10 @@ def main(args=None, app=None):
procs = []
for vm in domains:
if not args.autostart and not vm.is_running():
if verbose > 0:
print_no_color('Qube \'{}\' not started'.format(vm.name),
file=sys.stderr, color=args.color_stderr)
retcode = max(retcode, 1)
continue
try:
if verbose > 0: