Some better logic here rather than using and/or
This commit is contained in:
parent
50f34810bc
commit
ef49260762
|
@ -212,12 +212,18 @@ class VMInstance:
|
||||||
self.dom = self.lookupByUUID(self.domuuid)
|
self.dom = self.lookupByUUID(self.domuuid)
|
||||||
print(self.state)
|
print(self.state)
|
||||||
|
|
||||||
if self.dom == None or self.state == 'migrate':
|
if self.dom == None and self.state == 'migrate':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING and self.state != 'migrate':
|
if self.state != 'migrate':
|
||||||
break
|
break
|
||||||
|
|
||||||
|
try:
|
||||||
|
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
|
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
|
||||||
if not self.domuuid in self.thishypervisor.domain_list:
|
if not self.domuuid in self.thishypervisor.domain_list:
|
||||||
self.thishypervisor.domain_list.append(self.domuuid)
|
self.thishypervisor.domain_list.append(self.domuuid)
|
||||||
|
|
Loading…
Reference in New Issue