From 57b3c62fb09d1003d7a6c25cbf2fa14a06def692 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 20 Aug 2018 13:43:00 -0400 Subject: [PATCH] Move node_mem_allocated to inside try block Addresses #17 --- pvc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvc.py b/pvc.py index fa8898b9..aebddfe5 100755 --- a/pvc.py +++ b/pvc.py @@ -203,9 +203,9 @@ def getInformationFromNode(zk_conn, node_name, long_output): try: parsed_xml = getDomainXML(zk_conn, domain) duuid, dname, dmemory, dvcpu, dvcputopo = getDomainMainDetails(parsed_xml) + node_mem_allocated += int(dmemory) except AttributeError: click.echo('Error: Domain {} does not exist.'.format(domain)) - node_mem_allocated += int(dmemory) if node_daemon_state == 'run': daemon_state_colour = ansiiprint.green() @@ -700,9 +700,9 @@ def node_list(limit): try: parsed_xml = getDomainXML(zk_conn, domain) duuid, dname, dmemory, dvcpu, dvcputopo = getDomainMainDetails(parsed_xml) + node_mem_allocated[node_name] += int(dmemory) except AttributeError: click.echo('Error: Domain {} does not exist.'.format(domain)) - node_mem_allocated[node_name] += int(dmemory) # Determine optimal column widths # Dynamic columns: node_name, hypervisor, migrated