From 61aef9fd3ea69e5c2e7a487a9cfc4d670da254aa Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Thu, 19 Jul 2018 22:01:31 -0400 Subject: [PATCH] Fix listing bug in node info Fixes a listing bug during 'node info -l' introduced in previous commit 4a3780cf as a "cleanup", and makes this a little more elegant. References #12 --- pvc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvc.py b/pvc.py index 366c0ff7..0bb5106c 100755 --- a/pvc.py +++ b/pvc.py @@ -1339,10 +1339,11 @@ def get_vm_list(hypervisor, limit): exit(1) # Check hypervisor to avoid unneeded ZK calls vm_hypervisor[vm] = zk_conn.get('/domains/{}/hypervisor'.format(vm))[0].decode('ascii') - if hypervisor != None and vm_hypervisor[vm] == hypervisor: + if hypervisor == None: vm_list.append(vm) else: - vm_list.append(vm) + if vm_hypervisor[vm] == hypervisor: + vm_list.append(vm) # Gather information for printing for vm in vm_list: