iotests: Fix run_job() with use_log=False

The 'job-complete' QMP command should be run with qmp() rather than
qmp_log() if use_log=False is passed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200310113831.27293-4-kwolf@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2020-03-10 12:38:27 +01:00
parent d29d3d1f80
commit b31b532122

View File

@ -624,7 +624,10 @@ class VM(qtest.QEMUQtestMachine):
if use_log:
log('Job failed: %s' % (j['error']))
elif status == 'ready':
self.qmp_log('job-complete', id=job)
if use_log:
self.qmp_log('job-complete', id=job)
else:
self.qmp('job-complete', id=job)
elif status == 'pending' and not auto_finalize:
if pre_finalize:
pre_finalize()