Some more cleanup and avoid opening libvirt connections until they're really needed

This commit is contained in:
2018-06-04 01:22:18 -04:00
parent ad4a9d8ea6
commit 8eb91a4ec3
3 changed files with 33 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os, sys, socket, time, threading, libvirt, kazoo.client, pvcdomf
import os, sys, socket, time, threading, libvirt, kazoo.client, pvcf
class NodeInstance(threading.Thread):
def __init__(self, name, node_list, s_domain, zk):
@@ -104,7 +104,7 @@ class NodeInstance(threading.Thread):
# Remove any non-running VMs from our list
for domain in self.domain_list:
dom = pvcdomf.lookupByUUID(conn, domain)
dom = pvcdomf.lookupByUUID(domain)
if dom == None:
self.domain_list.remove(domain)
else: