Recreate network in aggregator if DNS changes
This commit is contained in:
parent
0a8dd30a48
commit
78f053d81f
|
@ -796,7 +796,7 @@ if enable_networking:
|
||||||
# Add any missing networks to the list
|
# Add any missing networks to the list
|
||||||
for network in new_network_list:
|
for network in new_network_list:
|
||||||
if not network in network_list:
|
if not network in network_list:
|
||||||
d_network[network] = VXNetworkInstance.VXNetworkInstance(network, zk_conn, config, logger, this_node)
|
d_network[network] = VXNetworkInstance.VXNetworkInstance(network, zk_conn, config, logger, this_node, dns_aggregator)
|
||||||
if config['daemon_mode'] == 'coordinator' and d_network[network].nettype == 'managed':
|
if config['daemon_mode'] == 'coordinator' and d_network[network].nettype == 'managed':
|
||||||
try:
|
try:
|
||||||
dns_aggregator.add_network(d_network[network])
|
dns_aggregator.add_network(d_network[network])
|
||||||
|
|
|
@ -31,12 +31,13 @@ import pvcd.common as common
|
||||||
|
|
||||||
class VXNetworkInstance(object):
|
class VXNetworkInstance(object):
|
||||||
# Initialization function
|
# Initialization function
|
||||||
def __init__ (self, vni, zk_conn, config, logger, this_node):
|
def __init__ (self, vni, zk_conn, config, logger, this_node, dns_aggregator):
|
||||||
self.vni = vni
|
self.vni = vni
|
||||||
self.zk_conn = zk_conn
|
self.zk_conn = zk_conn
|
||||||
self.config = config
|
self.config = config
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.this_node = this_node
|
self.this_node = this_node
|
||||||
|
self.dns_aggregator = dns_aggregator
|
||||||
self.vni_dev = config['vni_dev']
|
self.vni_dev = config['vni_dev']
|
||||||
self.vni_mtu = config['vni_mtu']
|
self.vni_mtu = config['vni_mtu']
|
||||||
|
|
||||||
|
@ -184,8 +185,11 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out
|
||||||
|
|
||||||
if data and self.domain != data.decode('ascii'):
|
if data and self.domain != data.decode('ascii'):
|
||||||
domain = data.decode('ascii')
|
domain = data.decode('ascii')
|
||||||
|
if self.dhcp_server_daemon:
|
||||||
|
self.dns_aggregator.remove_network(self)
|
||||||
self.domain = domain
|
self.domain = domain
|
||||||
if self.dhcp_server_daemon:
|
if self.dhcp_server_daemon:
|
||||||
|
self.dns_aggregator.add_network(self)
|
||||||
self.stopDHCPServer()
|
self.stopDHCPServer()
|
||||||
self.startDHCPServer()
|
self.startDHCPServer()
|
||||||
|
|
||||||
|
@ -198,8 +202,11 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out
|
||||||
|
|
||||||
if data and self.name_servers != data.decode('ascii'):
|
if data and self.name_servers != data.decode('ascii'):
|
||||||
name_servers = data.decode('ascii').split(',')
|
name_servers = data.decode('ascii').split(',')
|
||||||
|
if self.dhcp_server_daemon:
|
||||||
|
self.dns_aggregator.remove_network(self)
|
||||||
self.name_servers = name_servers
|
self.name_servers = name_servers
|
||||||
if self.dhcp_server_daemon:
|
if self.dhcp_server_daemon:
|
||||||
|
self.dns_aggregator.add_network(self)
|
||||||
self.stopDHCPServer()
|
self.stopDHCPServer()
|
||||||
self.startDHCPServer()
|
self.startDHCPServer()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue