From a8e1badbd2e20574414a926350070d03c133340c Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 2 Oct 2016 12:19:27 +0000 Subject: [PATCH] Expose OVS bridge related options into metering agent config file Agent state options (report_interval), or interface related options (f.e. ovs_integration_bridge) should be exposed into all configuration files for all agents that may report a state, or instantiate a bridge object. Since some of options that were previously considered 'base' don't apply to metering agent (specifically, availability_zone), moved them into separate lists and included them into relevant agents (l3 and dhcp). The only glitch with the change is that log_agent_heartbeats option is now exposed into metering agent configuration file, even though the agent does not honour it. I think it's minor and we can live with it. Change-Id: Ibceca20cec60e75a8c6ddd35f3f9cb8cca272a9e --- etc/oslo-config-generator/dhcp_agent.ini | 1 + etc/oslo-config-generator/l3_agent.ini | 1 + etc/oslo-config-generator/metering_agent.ini | 1 + neutron/opts.py | 18 ++++++++---------- setup.cfg | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/oslo-config-generator/dhcp_agent.ini b/etc/oslo-config-generator/dhcp_agent.ini index 13a0de18234..c9bd3c4ebeb 100644 --- a/etc/oslo-config-generator/dhcp_agent.ini +++ b/etc/oslo-config-generator/dhcp_agent.ini @@ -2,6 +2,7 @@ output_file = etc/dhcp_agent.ini.sample wrap_width = 79 +namespace = neutron.az.agent namespace = neutron.base.agent namespace = neutron.dhcp.agent namespace = oslo.log diff --git a/etc/oslo-config-generator/l3_agent.ini b/etc/oslo-config-generator/l3_agent.ini index 82bf2ca683c..755edb9e62a 100644 --- a/etc/oslo-config-generator/l3_agent.ini +++ b/etc/oslo-config-generator/l3_agent.ini @@ -2,6 +2,7 @@ output_file = etc/l3_agent.ini.sample wrap_width = 79 +namespace = neutron.az.agent namespace = neutron.base.agent namespace = neutron.l3.agent namespace = oslo.log diff --git a/etc/oslo-config-generator/metering_agent.ini b/etc/oslo-config-generator/metering_agent.ini index 9c00d30efec..608879715a0 100644 --- a/etc/oslo-config-generator/metering_agent.ini +++ b/etc/oslo-config-generator/metering_agent.ini @@ -2,5 +2,6 @@ output_file = etc/metering_agent.ini.sample wrap_width = 79 +namespace = neutron.base.agent namespace = neutron.metering.agent namespace = oslo.log diff --git a/neutron/opts.py b/neutron/opts.py index 639e25453e1..33f5d96a6f3 100644 --- a/neutron/opts.py +++ b/neutron/opts.py @@ -156,11 +156,13 @@ def list_base_agent_opts(): neutron.agent.common.config.INTERFACE_DRIVER_OPTS, neutron.conf.agent.ovs_conf.OPTS) ), - ('AGENT', - itertools.chain( - neutron.agent.common.config.AGENT_STATE_OPTS, - neutron.agent.common.config.AVAILABILITY_ZONE_OPTS) - ) + ('AGENT', neutron.agent.common.config.AGENT_STATE_OPTS), + ] + + +def list_az_agent_opts(): + return [ + ('AGENT', neutron.agent.common.config.AVAILABILITY_ZONE_OPTS), ] @@ -230,11 +232,7 @@ def list_metadata_agent_opts(): def list_metering_agent_opts(): return [ - ('DEFAULT', - itertools.chain( - neutron.conf.services.metering_agent.metering_agent_opts, - neutron.agent.common.config.INTERFACE_DRIVER_OPTS) - ) + ('DEFAULT', neutron.conf.services.metering_agent.metering_agent_opts), ] diff --git a/setup.cfg b/setup.cfg index 96e5ebe9d12..f22b87f298e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -129,6 +129,7 @@ oslo.messaging.notify.drivers = oslo.config.opts = neutron = neutron.opts:list_opts neutron.agent = neutron.opts:list_agent_opts + neutron.az.agent = neutron.opts:list_az_agent_opts neutron.base.agent = neutron.opts:list_base_agent_opts neutron.db = neutron.opts:list_db_opts neutron.dhcp.agent = neutron.opts:list_dhcp_agent_opts