Revert "Add cleanup of local domain list during VM check"

This reverts commit d39f41980b.
This commit is contained in:
Joshua Boniface 2018-06-19 19:52:08 -04:00
parent 5279c019d2
commit 8af0cddc50
1 changed files with 8 additions and 14 deletions

View File

@ -203,20 +203,14 @@ class NodeInstance():
# Toggle state management of dead VMs to restart them # Toggle state management of dead VMs to restart them
for domain, instance in self.s_domain.items(): for domain, instance in self.s_domain.items():
if instance.inshutdown == False and domain in self.domain_list: if instance.inshutdown == False and domain in self.domain_list:
if instance.gethypervisor() == self.name: if instance.getstate() == 'start' and instance.gethypervisor() == self.name:
if instance.getstate() == 'start': if instance.getdom() != None:
if instance.getdom() != None: try:
try: if instance.getdom().state()[0] != libvirt.VIR_DOMAIN_RUNNING:
if instance.getdom().state()[0] != libvirt.VIR_DOMAIN_RUNNING: raise
raise except Exception as e:
except Exception as e: # Toggle a state "change"
# Toggle a state "change" self.zk_conn.set('/domains/{}/state'.format(domain), instance.getstate().encode('ascii'))
self.zk_conn.set('/domains/{}/state'.format(domain), instance.getstate().encode('ascii'))
else:
self.domain_list.remove(domain)
else:
self.domain_list.remove(domain)
# Set our information in zookeeper # Set our information in zookeeper
self.name = lv_conn.getHostname() self.name = lv_conn.getHostname()