Add ability to update nodelists

This commit is contained in:
2018-05-31 23:01:22 -04:00
parent 16613d900e
commit 77c5c2ccf7
2 changed files with 14 additions and 6 deletions

15
pvcd.py
View File

@ -59,8 +59,16 @@ if not zk.exists('%s' + mynodestring):
time.sleep(1)
def updatenodes():
node_list = zk.get_children('/nodes')
print(node_list)
for node in node_list:
if t_node[node] is None:
t_node[node] = NodeInstance.NodeInstance(node, node_list, zk);
else:
t_node[node].updatenodelist(node_list)
node_list = zk.get_children('/nodes')
print(node_list)
domain_list = zk.get_children('/domains')
print(domain_list)
@ -68,11 +76,6 @@ print(domain_list)
t_node = dict()
s_domain = dict()
for node in node_list:
t_node[node] = NodeInstance.NodeInstance(node, node_list, zk);
if t_node[node].name == myhostname:
t_node[node].start()
time.sleep(1)
for domain in domain_list: