Use right states
This commit is contained in:
parent
a9635aac16
commit
1db8655f91
|
@ -331,8 +331,9 @@ def fenceNode(node_name, zk):
|
||||||
current_hypervisor = zk.get('/domains/{}/hypervisor'.format(dom_uuid))[0].decode('ascii')
|
current_hypervisor = zk.get('/domains/{}/hypervisor'.format(dom_uuid))[0].decode('ascii')
|
||||||
for hypervisor in hypervisor_list:
|
for hypervisor in hypervisor_list:
|
||||||
print(hypervisor)
|
print(hypervisor)
|
||||||
state = zk.get('/nodes/{}/domainstate'.format(hypervisor))[0].decode('ascii')
|
daemonstate = zk.get('/nodes/{}/daemonstate'.format(hypervisor))[0].decode('ascii')
|
||||||
if state != 'ready':
|
domainstate = zk.get('/nodes/{}/domainstate'.format(hypervisor))[0].decode('ascii')
|
||||||
|
if daemonstate != 'run' or domainstate != 'ready':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
memfree = int(zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii'))
|
memfree = int(zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii'))
|
||||||
|
|
Loading…
Reference in New Issue