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 <apahim@redhat.com>
Message-Id: <20170901112829.2571-2-apahim@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									4d9342977a
								
							
						
					
					
						commit
						f6cf7f5a22
					
				@ -131,7 +131,7 @@ class QEMUMachine(object):
 | 
				
			|||||||
            raise
 | 
					            raise
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def is_running(self):
 | 
					    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):
 | 
					    def exitcode(self):
 | 
				
			||||||
        if self._popen is None:
 | 
					        if self._popen is None:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user