More fixes

This commit is contained in:
Joshua Boniface 2018-05-31 23:33:07 -04:00
parent fe53a63039
commit cf1d9bc327
1 changed files with 2 additions and 1 deletions

View File

@ -40,8 +40,10 @@ def zk_listener(state):
zk.add_listener(zk_listener)
myhostname = socket.gethostname()
mynodestring = '/nodes/%s' % myhostname
def cleanup():
zk.set('%s/state' % mynodestring, 'stop'.encode('ascii'))
for node in node_list:
t_node[node].stop()
zk.stop()
@ -49,7 +51,6 @@ def cleanup():
atexit.register(cleanup)
# Check if our node exists in Zookeeper, and create it if not
mynodestring = '/nodes/%s' % myhostname
if zk.exists('%s' % mynodestring):
print("Node is present in Zookeeper")
else: