Add a short delay before managing state

This commit is contained in:
Joshua Boniface 2018-06-11 21:32:13 -04:00
parent d0c8f006c6
commit 202b8f41af
1 changed files with 3 additions and 0 deletions

View File

@ -236,6 +236,9 @@ class VMInstance:
# Main function to manage a VM (taking only self) # Main function to manage a VM (taking only self)
# #
def manage_vm_state(self): def manage_vm_state(self):
# Give ourselves a bit of leeway time
time.sleep(0.2)
# Get the current values from zookeeper # Get the current values from zookeeper
self.state = self.zk.get('/domains/{}/state'.format(self.domuuid))[0].decode('ascii') self.state = self.zk.get('/domains/{}/state'.format(self.domuuid))[0].decode('ascii')
self.hypervisor = self.zk.get('/domains/{}/hypervisor'.format(self.domuuid))[0].decode('ascii') self.hypervisor = self.zk.get('/domains/{}/hypervisor'.format(self.domuuid))[0].decode('ascii')