Fix some bugs
This commit is contained in:
parent
6798d4c078
commit
60fba72976
2
pvc.py
2
pvc.py
|
@ -768,7 +768,7 @@ def undefine_vm(dom_name, dom_uuid):
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
# Gracefully terminate the class instances
|
# Gracefully terminate the class instances
|
||||||
transaction.set_data('/domains/{}/state'.format(dom_uuid), 'delete'.encode('ascii'))
|
zk.set('/domains/{}/state'.format(dom_uuid), 'delete'.encode('ascii'))
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
# Delete the configurations
|
# Delete the configurations
|
||||||
click.echo('Undefining VM "{}".'.format(dom_uuid))
|
click.echo('Undefining VM "{}".'.format(dom_uuid))
|
||||||
|
|
|
@ -48,8 +48,8 @@ class VMInstance:
|
||||||
@zk.DataWatch('/domains/{}/state'.format(self.domuuid))
|
@zk.DataWatch('/domains/{}/state'.format(self.domuuid))
|
||||||
def watch_state(data, stat, event=""):
|
def watch_state(data, stat, event=""):
|
||||||
# If we get a delete state, just terminate outselves
|
# If we get a delete state, just terminate outselves
|
||||||
if state == 'delete':
|
if data.decode('ascii') == 'delete':
|
||||||
del self
|
self.__delete__
|
||||||
# Otherwise perform a management command
|
# Otherwise perform a management command
|
||||||
else:
|
else:
|
||||||
self.manage_vm_state()
|
self.manage_vm_state()
|
||||||
|
|
Loading…
Reference in New Issue