From b17bf9ed8d52ac285a67d58635cb652cea82e22b Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Wed, 20 Jan 2016 16:38:56 +0000 Subject: [PATCH] Change to the dhcp-agents-per-network setting such that it is always active and not just when enable-l3ha is true. This is to provide non-ha environments with the option to have multiple dhcp agents (which are controlled directly by neutron). The default, is therefore, 1. --- config.yaml | 2 +- hooks/neutron_api_context.py | 2 +- unit_tests/test_neutron_api_context.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index 0b1978d6..7d424981 100755 --- a/config.yaml +++ b/config.yaml @@ -399,7 +399,7 @@ options: Minimum number of l3 agents to host a router. Only used when enable-l3ha is True dhcp-agents-per-network: - default: 2 + default: 1 type: int description: | The number of dhcp agents to be deployed per network. This option is diff --git a/hooks/neutron_api_context.py b/hooks/neutron_api_context.py index 441caa4b..5af5aa26 100644 --- a/hooks/neutron_api_context.py +++ b/hooks/neutron_api_context.py @@ -174,7 +174,7 @@ class NeutronCCContext(context.NeutronContext): config('max-l3-agents-per-router') ctxt['min_l3_agents_per_router'] = \ config('min-l3-agents-per-router') - ctxt['dhcp_agents_per_network'] = config('dhcp-agents-per-network') + ctxt['dhcp_agents_per_network'] = config('dhcp-agents-per-network') ctxt['overlay_network_type'] = self.neutron_overlay_network_type ctxt['external_network'] = config('neutron-external-network') if config('neutron-plugin') in ['vsp']: diff --git a/unit_tests/test_neutron_api_context.py b/unit_tests/test_neutron_api_context.py index b949b614..ea414f67 100644 --- a/unit_tests/test_neutron_api_context.py +++ b/unit_tests/test_neutron_api_context.py @@ -298,6 +298,7 @@ class NeutronCCContextTest(CharmTestCase): 'debug': True, 'enable_dvr': False, 'l3_ha': False, + 'dhcp_agents_per_network': 3, 'external_network': 'bob', 'neutron_bind_port': self.api_port, 'verbose': True, @@ -332,6 +333,7 @@ class NeutronCCContextTest(CharmTestCase): 'debug': True, 'enable_dvr': False, 'l3_ha': False, + 'dhcp_agents_per_network': 3, 'external_network': 'bob', 'neutron_bind_port': self.api_port, 'verbose': True,