From 8af0cddc50df8fc10d16ea500894752d35d8564d Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 19 Jun 2018 19:52:08 -0400 Subject: [PATCH] Revert "Add cleanup of local domain list during VM check" This reverts commit d39f41980b89d7218af919847cf50d79a5d05e0b. --- pvcd/NodeInstance.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pvcd/NodeInstance.py b/pvcd/NodeInstance.py index 7a5b831a..7900f8ac 100644 --- a/pvcd/NodeInstance.py +++ b/pvcd/NodeInstance.py @@ -203,20 +203,14 @@ class NodeInstance(): # Toggle state management of dead VMs to restart them for domain, instance in self.s_domain.items(): if instance.inshutdown == False and domain in self.domain_list: - if instance.gethypervisor() == self.name: - if instance.getstate() == 'start': - if instance.getdom() != None: - try: - if instance.getdom().state()[0] != libvirt.VIR_DOMAIN_RUNNING: - raise - except Exception as e: - # Toggle a state "change" - self.zk_conn.set('/domains/{}/state'.format(domain), instance.getstate().encode('ascii')) - else: - self.domain_list.remove(domain) - else: - self.domain_list.remove(domain) - + if instance.getstate() == 'start' and instance.gethypervisor() == self.name: + if instance.getdom() != None: + try: + if instance.getdom().state()[0] != libvirt.VIR_DOMAIN_RUNNING: + raise + except Exception as e: + # Toggle a state "change" + self.zk_conn.set('/domains/{}/state'.format(domain), instance.getstate().encode('ascii')) # Set our information in zookeeper self.name = lv_conn.getHostname()