From 90fa2e6b5ec21912f15dd1b971fe734ebc781ab6 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 6 Jun 2018 20:49:21 -0400 Subject: [PATCH] Fix missing self reference for ZK conn --- NodeInstance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NodeInstance.py b/NodeInstance.py index d7b80848..1291a700 100644 --- a/NodeInstance.py +++ b/NodeInstance.py @@ -90,14 +90,14 @@ class NodeInstance(): print('>>> Flushing node {} of running VMs.'.format(self.name)) for dom_uuid in self.domain_list: most_memfree = 0 - hypervisor_list = zk.get_children('/nodes') - current_hypervisor = zk.get('/dom_uuids/{}/hypervisor'.format(dom_uuid))[0].decode('ascii') + hypervisor_list = self.zk.get_children('/nodes') + current_hypervisor = self.zk.get('/dom_uuids/{}/hypervisor'.format(dom_uuid))[0].decode('ascii') for hypervisor in hypervisor_list: - state = zk.get('/nodes/{}/state'.format(hypervisor))[0].decode('ascii') + state = self.zk.get('/nodes/{}/state'.format(hypervisor))[0].decode('ascii') if state != 'start' or hypervisor == current_hypervisor: continue - memfree = int(zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii')) + memfree = int(self.zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii')) if memfree > most_memfree: most_memfree = memfree target_hypervisor = hypervisor