From a421bde6795903fefdaafb45f2b99f8dc5695f4e Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 18 Nov 2018 17:29:35 -0500 Subject: [PATCH] Fix up a few more bugs --- node-daemon/pvcd/DNSAggregatorInstance.py | 4 ++-- node-daemon/pvcd/Daemon.py | 3 ++- node-daemon/pvcd/NodeInstance.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/node-daemon/pvcd/DNSAggregatorInstance.py b/node-daemon/pvcd/DNSAggregatorInstance.py index fee7cdf4..83b24d03 100644 --- a/node-daemon/pvcd/DNSAggregatorInstance.py +++ b/node-daemon/pvcd/DNSAggregatorInstance.py @@ -363,8 +363,8 @@ class AXFRDaemonInstance(object): # Go through the new elements for newrecord in in_new_not_in_old: splitnewrecord = newrecord.split() - # If there's a name match with different content, remove the old one - if splitrecord[0] == splitnewrecord[0]: + # If there's a name and type match with different content, remove the old one + if splitrecord[0] == splitnewrecord[0] and splitrecord[3] == splitnewrecord[3]: remove_records.append(record_id) changed = False diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index fb7d50f6..ba70c263 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -604,7 +604,8 @@ def update_networks(new_network_list): if not network in network_list: d_network[network] = VXNetworkInstance.VXNetworkInstance(network, zk_conn, config, logger, this_node) print(network) - dns_aggregator.add_network(d_network[network]) + if config['daemon_mode'] == 'coordinator': + dns_aggregator.add_network(d_network[network]) # Start primary functionality if this_node.router_state == 'primary': d_network[network].createGateways() diff --git a/node-daemon/pvcd/NodeInstance.py b/node-daemon/pvcd/NodeInstance.py index 12b12d3f..5bd8b2f8 100644 --- a/node-daemon/pvcd/NodeInstance.py +++ b/node-daemon/pvcd/NodeInstance.py @@ -245,11 +245,11 @@ class NodeInstance(object): self.logger.out('Setting router {} to secondary state'.format(self.name), state='i') self.logger.out('Network list: {}'.format(', '.join(self.network_list))) time.sleep(1) - self.dns_aggregator.stop_aggregator() for network in self.d_network: self.d_network[network].stopDHCPServer() self.d_network[network].removeGateways() self.removeFloatingAddresses() + self.dns_aggregator.stop_aggregator() def become_primary(self): self.logger.out('Setting router {} to primary state.'.format(self.name), state='i')