Merge "changes ovs agent_id init to use hostname instead of mac"

This commit is contained in:
Jenkins 2014-06-23 18:38:53 +00:00 committed by Gerrit Code Review
commit 2ad79a3f9a
2 changed files with 7 additions and 9 deletions

View File

@ -240,8 +240,7 @@ class OVSNeutronAgent(rpc_compat.RpcCallback,
LOG.exception(_("Failed reporting state!")) LOG.exception(_("Failed reporting state!"))
def setup_rpc(self): def setup_rpc(self):
mac = self.int_br.get_local_port_mac() self.agent_id = 'ovs-agent-%s' % cfg.CONF.host
self.agent_id = '%s%s' % ('ovs', (mac.replace(":", "")))
self.topic = topics.AGENT self.topic = topics.AGENT
self.plugin_rpc = OVSPluginApi(topics.PLUGIN) self.plugin_rpc = OVSPluginApi(topics.PLUGIN)
self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)

View File

@ -105,10 +105,8 @@ class TunnelTest(base.BaseTestCase):
] ]
self.mock_int_bridge = self.ovs_bridges[self.INT_BRIDGE] self.mock_int_bridge = self.ovs_bridges[self.INT_BRIDGE]
self.mock_int_bridge.get_local_port_mac.return_value = '000000000001'
self.mock_int_bridge_expected = [ self.mock_int_bridge_expected = [
mock.call.set_secure_mode(), mock.call.set_secure_mode(),
mock.call.get_local_port_mac(),
mock.call.delete_port('patch-tun'), mock.call.delete_port('patch-tun'),
mock.call.remove_all_flows(), mock.call.remove_all_flows(),
mock.call.add_flow(priority=1, actions='normal'), mock.call.add_flow(priority=1, actions='normal'),
@ -249,11 +247,12 @@ class TunnelTest(base.BaseTestCase):
self._verify_mock_call(self.execute, self.execute_expected) self._verify_mock_call(self.execute, self.execute_expected)
def test_construct(self): def test_construct(self):
ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, agent = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE, self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING, '10.0.0.1', self.NET_MAPPING,
'sudo', 2, ['gre'], 'sudo', 2, ['gre'],
self.VETH_MTU) self.VETH_MTU)
self.assertEqual(agent.agent_id, 'ovs-agent-%s' % cfg.CONF.host)
self._verify_mock_calls() self._verify_mock_calls()
# TODO(ethuleau): Initially, local ARP responder is be dependent to the # TODO(ethuleau): Initially, local ARP responder is be dependent to the