aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-05-09 00:17:44 -0700
committerStefan Kobza <skobza@cisco.com>2016-05-09 10:18:24 +0000
commit56873a866fc17056e467fe7cafb2c987181f209a (patch)
treed9aae04a97fddbc1ac83b7a3f6b00b58cc53cc50
parentf32168ef95c3b68567ccd57e098d74ad9a536edd (diff)
QEMU VM guest-ping fix
JIRA: CSIT-62 Change-Id: I0affda16af8f983895c50fbc306f45f30fbb69cd Signed-off-by: Matus Fabian <matfabia@cisco.com>
-rw-r--r--resources/libraries/python/QemuUtils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py
index 6658c07df9..282b157eb8 100644
--- a/resources/libraries/python/QemuUtils.py
+++ b/resources/libraries/python/QemuUtils.py
@@ -214,7 +214,7 @@ class QemuUtils(object):
logger.trace(stdout)
if not stdout:
return {}
- return json.loads(stdout)
+ return json.loads(stdout.split('\n', 1)[0])
def _wait_until_vm_boot(self, timeout=300):
"""Wait until QEMU VM is booted.
@@ -236,6 +236,9 @@ class QemuUtils(object):
# Non-error return - VM booted
elif out.get('return') is not None:
break
+ # Skip error and wait
+ elif out.get('error') is not None:
+ sleep(5)
else:
raise RuntimeError('QGA guest-ping unexpected output {}'.format(
out))