diff --git a/VMInstance.py b/VMInstance.py index 1d9ecebd..33b3b866 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -39,25 +39,23 @@ class VMInstance: self.inshutdown = False self.inmigrate = False self.inreceive = False - self.ininit = True self.dom = self.lookupByUUID(self.domuuid) # Watch for changes to the state field in Zookeeper @zk.DataWatch('/domains/{}/state'.format(self.domuuid)) def watch_state(data, stat, event=""): - if self.ininit == False: - self.manage_vm_state() + self.manage_vm_state() # Watch for changes to the hypervisor field in Zookeeper - @zk.DataWatch('/domains/{}/hypervisor'.format(self.domuuid)) - def watch_hypervisor(data, stat, event=""): - if self.ininit == False: - self.manage_vm_state() - else: - # This case handles the very first init at startup to avoid it happening twice - self.ininit = False - self.manage_vm_state() +# @zk.DataWatch('/domains/{}/hypervisor'.format(self.domuuid)) +# def watch_hypervisor(data, stat, event=""): +# if self.ininit == False: +# self.manage_vm_state() +# else: +# # This case handles the very first init at startup to avoid it happening twice +# self.ininit = False +# self.manage_vm_state() # Get data functions def getstate(self):