From 4afb28842929231f6bef308190e2b53d0224ba76 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 15 Aug 2020 12:07:23 -0400 Subject: [PATCH] Properly handle missing domain_name fail --- node-daemon/pvcnoded/Daemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index ad12593c..932d0dc1 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -1346,8 +1346,8 @@ def collect_vm_stats(queue): domain_memory_stats = domain.memoryStats() domain_cpu_stats = domain.getCPUStats(True)[0] except Exception as e: - if debug: - print("Failed getting VM information for {}: {}".format(domain_name, e)) + if debug and domain is defined: + print("Failed getting VM information for {}: {}".format(domain.name(), e)) continue # Ensure VM is present in the domain_list