Add delete of class object on delete call
This commit is contained in:
parent
dd8b7d69cc
commit
6798d4c078
|
@ -47,7 +47,12 @@ class VMInstance:
|
||||||
# Watch for changes to the state field in Zookeeper
|
# Watch for changes to the state field in Zookeeper
|
||||||
@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=""):
|
||||||
self.manage_vm_state()
|
# If we get a delete state, just terminate outselves
|
||||||
|
if state == 'delete':
|
||||||
|
del self
|
||||||
|
# Otherwise perform a management command
|
||||||
|
else:
|
||||||
|
self.manage_vm_state()
|
||||||
|
|
||||||
# Get data functions
|
# Get data functions
|
||||||
def getstate(self):
|
def getstate(self):
|
||||||
|
|
Loading…
Reference in New Issue