Get flush working properly

This commit is contained in:
2018-06-04 02:22:59 -04:00
parent 55ebbea6cf
commit 1a72ee6414
2 changed files with 28 additions and 20 deletions

14
pvcd.py
View File

@@ -68,25 +68,22 @@ else:
t_node = dict()
s_domain = dict()
node_list = []
domain_list = []
@zk.ChildrenWatch('/nodes')
def updatenodes(new_node_list):
global node_list
node_list = new_node_list
print('Node list: %s' % node_list)
for node in node_list:
if node in t_node:
t_node[node].updatenodelist(t_node)
else:
t_node[node] = NodeInstance.NodeInstance(node, t_node, s_domain, zk);
if node == myhostname:
t_node[node].start()
time.sleep(0.2)
for node in node_list:
if node in t_node:
t_node[node].updatenodelist(t_node)
t_node[node] = NodeInstance.NodeInstance(node, t_node, s_domain, zk)
@zk.ChildrenWatch('/domains')
def updatedomains(new_domain_list):
global domain_list
domain_list = new_domain_list
print('Domain list: %s' % domain_list)
for domain in domain_list:
@@ -96,6 +93,9 @@ def updatedomains(new_domain_list):
if node in t_node:
t_node[node].updatedomainlist(s_domain)
t_node[myhostname].start()
time.sleep(0.2)
while True:
# Tick loop
try: