Add and remove dnsaggregator nets on primary change
This commit is contained in:
parent
5740df3a04
commit
fd27d3f544
|
@ -326,10 +326,13 @@ def cleanup():
|
|||
|
||||
# Force into secondary network state if needed
|
||||
if this_node.name == this_node.primary_node:
|
||||
zkhandler.writedata(zk_conn, { '/primary_node': 'none' })
|
||||
zkhandler.writedata(zk_conn, {
|
||||
'/nodes/{}/routerstate'.format(myhostname): 'secondary',
|
||||
'/primary_node': 'none'
|
||||
})
|
||||
|
||||
# Wait for things to flush
|
||||
time.sleep(2)
|
||||
time.sleep(3)
|
||||
|
||||
# Set stop state in Zookeeper
|
||||
zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'stop' })
|
||||
|
@ -344,6 +347,8 @@ def cleanup():
|
|||
except:
|
||||
pass
|
||||
|
||||
logger.out('Exiting pvc daemon', state='s')
|
||||
|
||||
# Handle exit gracefully
|
||||
atexit.register(cleanup)
|
||||
|
||||
|
|
|
@ -264,6 +264,7 @@ class NodeInstance(object):
|
|||
for network in self.d_network:
|
||||
self.d_network[network].stopDHCPServer()
|
||||
self.d_network[network].removeGatewayAddress()
|
||||
self.dns_aggregator.remove_client_network(network)
|
||||
self.dns_aggregator.stop_aggregator()
|
||||
self.removeFloatingAddresses()
|
||||
|
||||
|
@ -275,6 +276,7 @@ class NodeInstance(object):
|
|||
time.sleep(0.5)
|
||||
# Start up the gateways and DHCP servers
|
||||
for network in self.d_network:
|
||||
self.dns_aggregator.add_client_network(network)
|
||||
self.d_network[network].createGatewayAddress()
|
||||
self.d_network[network].startDHCPServer()
|
||||
time.sleep(0.5)
|
||||
|
|
Loading…
Reference in New Issue