From 04918b8a4ff77121183028339ad63f25f7e1c834 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Fri, 15 Jun 2018 01:50:39 -0400 Subject: [PATCH] OK really fix the bugs --- pvc.py | 4 ++-- pvc/VMInstance.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pvc.py b/pvc.py index b33e35ba..a6cb7d3e 100755 --- a/pvc.py +++ b/pvc.py @@ -765,11 +765,11 @@ def undefine_vm(dom_name, dom_uuid): # Wait for 3 seconds to allow state to flow to all hypervisors click.echo('Waiting for cluster to update.') - time.sleep(3) + time.sleep(1) # Gracefully terminate the class instances zk.set('/domains/{}/state'.format(dom_uuid), 'delete'.encode('ascii')) - time.sleep(2) + time.sleep(5) # Delete the configurations click.echo('Undefining VM "{}".'.format(dom_uuid)) transaction = zk.transaction() diff --git a/pvc/VMInstance.py b/pvc/VMInstance.py index 4ed78114..2c085b1b 100644 --- a/pvc/VMInstance.py +++ b/pvc/VMInstance.py @@ -48,8 +48,8 @@ class VMInstance: @zk.DataWatch('/domains/{}/state'.format(self.domuuid)) def watch_state(data, stat, event=""): # If we get a delete state, just terminate outselves - if data.decode('ascii') == 'delete': - self.__delete__ + if data == None: + return # Otherwise perform a management command else: self.manage_vm_state()