From 1db8655f91af0a2df80df32c9a9caf2cd5840529 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 17 Jun 2018 02:02:28 -0400 Subject: [PATCH] Use right states --- pvc/NodeInstance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvc/NodeInstance.py b/pvc/NodeInstance.py index a2c0cfc0..c11374f5 100644 --- a/pvc/NodeInstance.py +++ b/pvc/NodeInstance.py @@ -331,8 +331,9 @@ def fenceNode(node_name, zk): current_hypervisor = zk.get('/domains/{}/hypervisor'.format(dom_uuid))[0].decode('ascii') for hypervisor in hypervisor_list: print(hypervisor) - state = zk.get('/nodes/{}/domainstate'.format(hypervisor))[0].decode('ascii') - if state != 'ready': + daemonstate = zk.get('/nodes/{}/daemonstate'.format(hypervisor))[0].decode('ascii') + domainstate = zk.get('/nodes/{}/domainstate'.format(hypervisor))[0].decode('ascii') + if daemonstate != 'run' or domainstate != 'ready': continue memfree = int(zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii'))