Clean up some more problems with migrate/flush and remove some crufty code

This commit is contained in:
Joshua Boniface 2018-06-04 16:37:58 -04:00
parent f1f6d10b0c
commit d666c5faff
1 changed files with 3 additions and 14 deletions

View File

@ -68,7 +68,7 @@ class NodeInstance(threading.Thread):
# Determine the best target hypervisor # Determine the best target hypervisor
least_mem = 2**64 least_mem = 2**64
least_host = None 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 # It should never include itself, but just in case
if node_name == self.name: if node_name == self.name:
continue continue
@ -116,8 +116,6 @@ class NodeInstance(threading.Thread):
def run(self): def run(self):
if self.name == socket.gethostname(): if self.name == socket.gethostname():
self.setup_local_node() self.setup_local_node()
else:
self.setup_remote_node()
def setup_local_node(self): def setup_local_node(self):
# Connect to libvirt # Connect to libvirt
@ -194,17 +192,8 @@ class NodeInstance(threading.Thread):
# Do any actions my node requires # Do any actions my node requires
# Sleep for 10s but with quick interruptability # Sleep for 9s but with quick interruptability
for x in range(0,100): for x in range(0,90):
time.sleep(0.1) time.sleep(0.1)
if self.stop_thread.is_set(): if self.stop_thread.is_set():
return 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