Remove some logic from wtach functions
This commit is contained in:
parent
2f289df540
commit
4c59fe03aa
|
@ -24,16 +24,12 @@ class VMInstance:
|
||||||
# Watch for changes to the hypervisor field in Zookeeper
|
# Watch for changes to the hypervisor field in Zookeeper
|
||||||
@zk.DataWatch(self.zkey + '/hypervisor')
|
@zk.DataWatch(self.zkey + '/hypervisor')
|
||||||
def watch_hypervisor(data, stat, event=""):
|
def watch_hypervisor(data, stat, event=""):
|
||||||
if self.hypervisor != data.decode('ascii'):
|
self.manage_vm_state()
|
||||||
self.hypervisor = data.decode('ascii')
|
|
||||||
self.manage_vm_state()
|
|
||||||
|
|
||||||
# Watch for changes to the state field in Zookeeper
|
# Watch for changes to the state field in Zookeeper
|
||||||
@zk.DataWatch(self.zkey + '/state')
|
@zk.DataWatch(self.zkey + '/state')
|
||||||
def watch_state(data, stat, event=""):
|
def watch_state(data, stat, event=""):
|
||||||
if self.state != data.decode('ascii'):
|
self.manage_vm_state()
|
||||||
self.state = data.decode('ascii')
|
|
||||||
self.manage_vm_state()
|
|
||||||
|
|
||||||
# Get data functions
|
# Get data functions
|
||||||
def getstate(self):
|
def getstate(self):
|
||||||
|
|
Loading…
Reference in New Issue