Set upstream IP in key if changed
This commit is contained in:
parent
10ae260b92
commit
237a37015d
|
@ -936,6 +936,15 @@ if enable_storage:
|
||||||
|
|
||||||
# Zookeeper keepalive update function
|
# Zookeeper keepalive update function
|
||||||
def update_zookeeper():
|
def update_zookeeper():
|
||||||
|
# Set the upstream IP in Zookeeper for clients to read
|
||||||
|
if config['enable_networking']:
|
||||||
|
if this_node.router_state == 'primary':
|
||||||
|
try:
|
||||||
|
if zkhandler.readdata(zk_conn, '/upstream_ip') != config['upstream_floating_ip']:
|
||||||
|
raise
|
||||||
|
except:
|
||||||
|
zkhandler.writedata(zk_conn, {'/upstream_ip': config['upstream_floating_ip']})
|
||||||
|
|
||||||
# Get past state and update if needed
|
# Get past state and update if needed
|
||||||
if debug:
|
if debug:
|
||||||
print("Get past state and update if needed")
|
print("Get past state and update if needed")
|
||||||
|
|
Loading…
Reference in New Issue