More fixes
This commit is contained in:
parent
fe53a63039
commit
cf1d9bc327
3
pvcd.py
3
pvcd.py
|
@ -40,8 +40,10 @@ def zk_listener(state):
|
||||||
zk.add_listener(zk_listener)
|
zk.add_listener(zk_listener)
|
||||||
|
|
||||||
myhostname = socket.gethostname()
|
myhostname = socket.gethostname()
|
||||||
|
mynodestring = '/nodes/%s' % myhostname
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
|
zk.set('%s/state' % mynodestring, 'stop'.encode('ascii'))
|
||||||
for node in node_list:
|
for node in node_list:
|
||||||
t_node[node].stop()
|
t_node[node].stop()
|
||||||
zk.stop()
|
zk.stop()
|
||||||
|
@ -49,7 +51,6 @@ def cleanup():
|
||||||
atexit.register(cleanup)
|
atexit.register(cleanup)
|
||||||
|
|
||||||
# Check if our node exists in Zookeeper, and create it if not
|
# Check if our node exists in Zookeeper, and create it if not
|
||||||
mynodestring = '/nodes/%s' % myhostname
|
|
||||||
if zk.exists('%s' % mynodestring):
|
if zk.exists('%s' % mynodestring):
|
||||||
print("Node is present in Zookeeper")
|
print("Node is present in Zookeeper")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue