From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id BD428762AA for ; Mon, 27 Jul 2015 21:16:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t6RLG9ng015297 for ; Mon, 27 Jul 2015 22:16:09 +0100 Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RNJkKzByTsRX for ; Mon, 27 Jul 2015 22:16:09 +0100 (BST) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t6RLFv2X015276 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 27 Jul 2015 22:16:09 +0100 Message-ID: <1438031757.821.282.camel@linuxfoundation.org> From: Richard Purdie To: openembedded-core Date: Mon, 27 Jul 2015 22:15:57 +0100 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Subject: [PATCH] oeqa/qemurunner: Fix AttributeError: QemuRunner instance has no attribute 'server_socket' X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2015 21:16:11 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 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