[OE-core] [PATCH] oeqa/qemurunner: Fix AttributeError: QemuRunner instance has no attribute 'server_socket'

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jul 27 21:15:57 UTC 2015


If start() returns False due to create_socker() failing, stop() may still get
called and currently this gives a track back since server_socket doesn't exist.

Avoid this.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 22bf91b..f81658f 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -174,7 +174,7 @@ class QemuRunner:
                 logging.info("Sending SIGKILL to runqemu")
                 os.killpg(self.runqemu.pid, signal.SIGKILL)
             self.runqemu = None
-        if self.server_socket:
+        if hasattr(self, 'server_socket'):
             self.server_socket.close()
             self.server_socket = None
         self.qemupid = None





More information about the Openembedded-core mailing list