From d666c5faff0a1e0e7b8046383f0204489115c006 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 4 Jun 2018 16:37:58 -0400 Subject: [PATCH] Clean up some more problems with migrate/flush and remove some crufty code --- NodeInstance.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/NodeInstance.py b/NodeInstance.py index 69dd3217..017a8dbd 100644 --- a/NodeInstance.py +++ b/NodeInstance.py @@ -68,7 +68,7 @@ class NodeInstance(threading.Thread): # Determine the best target hypervisor least_mem = 2**64 least_host = None - for node_name in self.t_node if self.t_node[node_name].getstate() == 'start': + for node_name in self.active_node_list: # It should never include itself, but just in case if node_name == self.name: continue @@ -116,8 +116,6 @@ class NodeInstance(threading.Thread): def run(self): if self.name == socket.gethostname(): self.setup_local_node() - else: - self.setup_remote_node() def setup_local_node(self): # Connect to libvirt @@ -194,17 +192,8 @@ class NodeInstance(threading.Thread): # Do any actions my node requires - # Sleep for 10s but with quick interruptability - for x in range(0,100): + # Sleep for 9s but with quick interruptability + for x in range(0,90): time.sleep(0.1) if self.stop_thread.is_set(): return - - def setup_remote_node(self): - while True: - for x in range(0,100): - time.sleep(0.1) - if self.stop_thread.is_set(): - return - -