From: Matus Fabian Date: Mon, 9 May 2016 07:17:44 +0000 (-0700) Subject: QEMU VM guest-ping fix X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=56873a866fc17056e467fe7cafb2c987181f209a;ds=inline QEMU VM guest-ping fix JIRA: CSIT-62 Change-Id: I0affda16af8f983895c50fbc306f45f30fbb69cd Signed-off-by: Matus Fabian --- 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))