Skip to content
Snippets Groups Projects
Commit f6cf7f5a authored by Amador Pahim's avatar Amador Pahim Committed by Eduardo Habkost
Browse files

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: default avatarAmador Pahim <apahim@redhat.com>
Message-Id: <20170901112829.2571-2-apahim@redhat.com>
Reviewed-by: default avatarFam Zheng <famz@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 4d934297
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ def _remove_if_exists(path):
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment