From: John Schwarz Date: Mon, 29 Sep 2014 13:28:18 +0000 (+0300) Subject: L3 agent should always use a unique CONF object X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=28660b19f5ef861d7d2ceba04faa7f263bdf8a37;p=openstack-build%2Fneutron-build.git L3 agent should always use a unique CONF object The l3 agent accepts an oslo configuration in its constructor and uses it throughout the code, but there are some references to the global configuration object held by the oslo library. Since HA functional tests need to create two agents, the configuration should be consistent throughout the code. The important difference between the agents is their 'host' value so that they create different namespaces, and 'state_path' value so the agents get their own filesystem root. Co-Authored-By: Assaf Muller Related-bug: #1374946 Change-Id: I3326889482681dd631ca59271ebd6a5d5129ae70 --- diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py index 308ab57ed..9580b4561 100644 --- a/neutron/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -776,7 +776,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, def _get_metadata_proxy_callback(self, router_id): def callback(pid_file): - metadata_proxy_socket = cfg.CONF.metadata_proxy_socket + metadata_proxy_socket = self.conf.metadata_proxy_socket proxy_cmd = ['neutron-ns-metadata-proxy', '--pid_file=%s' % pid_file, '--metadata_proxy_socket=%s' % metadata_proxy_socket, @@ -784,7 +784,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, '--state_path=%s' % self.conf.state_path, '--metadata_port=%s' % self.conf.metadata_port] proxy_cmd.extend(config.get_log_args( - cfg.CONF, 'neutron-ns-metadata-proxy-%s.log' % + self.conf, 'neutron-ns-metadata-proxy-%s.log' % router_id)) return proxy_cmd @@ -1949,7 +1949,7 @@ class L3NATAgentWithStateReport(L3NATAgent): 'interface_driver': self.conf.interface_driver}, 'start_flag': True, 'agent_type': l3_constants.AGENT_TYPE_L3} - report_interval = cfg.CONF.AGENT.report_interval + report_interval = self.conf.AGENT.report_interval self.use_call = True if report_interval: self.heartbeat = loopingcall.FixedIntervalLoopingCall(