Merge "ovs_neutron_agent: display loaded extensions" into stable/liberty

This commit is contained in:
Jenkins 2015-11-01 16:35:00 +00:00 committed by Gerrit Code Review
commit 08e8c968fa
2 changed files with 30 additions and 17 deletions

View File

@ -201,23 +201,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
self.arp_responder_enabled = arp_responder and self.l2_pop
self.prevent_arp_spoofing = prevent_arp_spoofing
self.agent_state = {
'binary': 'neutron-openvswitch-agent',
'host': self.conf.host,
'topic': n_const.L2_AGENT_TOPIC,
'configurations': {'bridge_mappings': bridge_mappings,
'tunnel_types': self.tunnel_types,
'tunneling_ip': local_ip,
'l2_population': self.l2_pop,
'arp_responder_enabled':
self.arp_responder_enabled,
'enable_distributed_routing':
self.enable_distributed_routing,
'log_agent_heartbeats':
self.conf.AGENT.log_agent_heartbeats},
'agent_type': self.conf.AGENT.agent_type,
'start_flag': True}
if tunnel_types:
self.enable_tunneling = True
else:
@ -282,6 +265,24 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
self.enable_tunneling,
self.enable_distributed_routing)
self.agent_state = {
'binary': 'neutron-openvswitch-agent',
'host': self.conf.host,
'topic': n_const.L2_AGENT_TOPIC,
'configurations': {'bridge_mappings': bridge_mappings,
'tunnel_types': self.tunnel_types,
'tunneling_ip': local_ip,
'l2_population': self.l2_pop,
'arp_responder_enabled':
self.arp_responder_enabled,
'enable_distributed_routing':
self.enable_distributed_routing,
'log_agent_heartbeats':
self.conf.AGENT.log_agent_heartbeats,
'extensions': self.ext_manager.names()},
'agent_type': self.conf.AGENT.agent_type,
'start_flag': True}
report_interval = self.conf.AGENT.report_interval
if report_interval:
heartbeat = loopingcall.FixedIntervalLoopingCall(

View File

@ -104,3 +104,15 @@ class TestOVSAgent(base.OVSAgentTestFramework):
while not done():
self.agent.setup_integration_br()
time.sleep(0.25)
class TestOVSAgentExtensionConfig(base.OVSAgentTestFramework):
def setUp(self):
super(TestOVSAgentExtensionConfig, self).setUp()
self.config.set_override('extensions', ['qos'], 'agent')
self.agent = self.create_agent(create_tunnels=False)
def test_report_loaded_extension(self):
self.agent._report_state()
agent_state = self.agent.state_rpc.report_state.call_args[0][1]
self.assertEqual(['qos'], agent_state['configurations']['extensions'])