From f6cf7f5a227ca0c8cc540d78d4f0f943c51ea8d1 Mon Sep 17 00:00:00 2001 From: Amador Pahim Date: Fri, 1 Sep 2017 13:28:17 +0200 Subject: qemu.py: fix is_running() return before first launch() is_running() returns None when called before the first time we call launch(): >>> import qemu >>> vm = qemu.QEMUMachine('qemu-system-x86_64') >>> vm.is_running() >>> It should return False instead. This patch fixes that. For consistence, this patch removes the parenthesis from the second clause as it's not really needed. Signed-off-by: Amador Pahim Message-Id: <20170901112829.2571-2-apahim@redhat.com> Reviewed-by: Fam Zheng Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/qemu.py') diff --git a/scripts/qemu.py b/scripts/qemu.py index 7c6802609a..f80b008f7f 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -131,7 +131,7 @@ class QEMUMachine(object): raise def is_running(self): - return self._popen and (self._popen.returncode is None) + return self._popen is not None and self._popen.returncode is None def exitcode(self): if self._popen is None: -- cgit v1.2.1