Catch exceptions if Patroni is not up

This commit is contained in:
Joshua Boniface 2019-08-07 11:46:58 -04:00
parent 7e77752ce5
commit 0446b2db02
1 changed files with 4 additions and 1 deletions

View File

@ -797,7 +797,10 @@ if enable_networking:
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)
if config['daemon_mode'] == 'coordinator' and d_network[network].nettype == 'managed': if config['daemon_mode'] == 'coordinator' and d_network[network].nettype == 'managed':
try:
dns_aggregator.add_network(d_network[network]) dns_aggregator.add_network(d_network[network])
except Exception as e:
logger.out('Failed to create DNS Aggregator for network {}'.format(network), 'w')
# Start primary functionality # Start primary functionality
if this_node.router_state == 'primary' and d_network[network].nettype == 'managed': if this_node.router_state == 'primary' and d_network[network].nettype == 'managed':
d_network[network].createGateways() d_network[network].createGateways()