diff --git a/VMInstance.py b/VMInstance.py index e2c4d3f1..59c9fa83 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -78,8 +78,11 @@ class VMInstance: def shutdown_vm(self): print(">>> Stopping VM %s" % self.domuuid) self.dom.shutdown() - while self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING: - time.sleep(0.5) + try: + while self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING: + time.sleep(0.5) + except: + pass if self.domuuid in self.thishypervisor.domain_list: try: