Finally get this working

This commit is contained in:
2018-06-01 01:26:21 -04:00
parent 5afb2f7520
commit bf1afbd7eb
2 changed files with 20 additions and 38 deletions

16
pvcd.py
View File

@@ -69,9 +69,6 @@ node_list = []
@zk.ChildrenWatch('/nodes')
def updatenodes(new_node_list):
node_list = new_node_list
active_node_list = []
flushed_node_list = []
inactive_node_list = []
print('Node list: %s' % node_list)
for node in node_list:
if node in t_node:
@@ -82,19 +79,6 @@ def updatenodes(new_node_list):
t_node[node].start()
time.sleep(0.5)
node_state = t_node[node].getstate()
print(node_state)
if node_state == 'start':
active_node_list.append(t_node[node].getname())
elif node_state == 'flush':
flushed_node_list.append(t_node[node].getname())
else:
inactive_node_list.append(t_node[node].getname())
print('Active nodes: %s' % active_node_list)
print('Flushed nodes: %s' % flushed_node_list)
print('Inactive nodes: %s' % inactive_node_list)
domain_list = zk.get_children('/domains')
print('Domain list: %s' % domain_list)