From 1db73bb892fd0b5a3eea95b0e874c306fff686e0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 6 Jun 2020 13:18:37 -0400 Subject: [PATCH] Move libvirt closure into previous section --- node-daemon/pvcnoded/Daemon.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index 2ef602e5..ddb8f86e 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -1302,6 +1302,9 @@ def node_keepalive(): if domain_uuid not in this_node.domain_list: this_node.domain_list.append(domain_uuid) + # Close the Libvirt connection + lv_conn.close() + # Set our information in zookeeper if debug: print("Set our information in zookeeper") @@ -1313,9 +1316,10 @@ def node_keepalive(): this_node.vcpualloc = vcpualloc this_node.cpuload = os.getloadavg()[0] if enable_hypervisor: - this_node.domains_count = len(lv_conn.listDomainsID()) + this_node.domains_count = len(running_domains) else: this_node.domains_count = 0 + keepalive_time = int(time.time()) try: zkhandler.writedata(zk_conn, { @@ -1333,10 +1337,6 @@ def node_keepalive(): logger.out('Failed to set keepalive data', state='e') return - if enable_hypervisor: - # Close the Libvirt connection - lv_conn.close() - # Look for dead nodes and fence them if not maintenance: if debug: