diff --git a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index c5b136b068..46b9bf4f08 100644 --- a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -240,8 +240,7 @@ class OVSNeutronAgent(rpc_compat.RpcCallback, LOG.exception(_("Failed reporting state!")) def setup_rpc(self): - mac = self.int_br.get_local_port_mac() - self.agent_id = '%s%s' % ('ovs', (mac.replace(":", ""))) + self.agent_id = 'ovs-agent-%s' % cfg.CONF.host self.topic = topics.AGENT self.plugin_rpc = OVSPluginApi(topics.PLUGIN) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) diff --git a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py index 642659037b..4ce7c168f2 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py +++ b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py @@ -105,10 +105,8 @@ class TunnelTest(base.BaseTestCase): ] 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 = [ mock.call.set_secure_mode(), - mock.call.get_local_port_mac(), mock.call.delete_port('patch-tun'), mock.call.remove_all_flows(), 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) def test_construct(self): - ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, - self.TUN_BRIDGE, - '10.0.0.1', self.NET_MAPPING, - 'sudo', 2, ['gre'], - self.VETH_MTU) + agent = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, + self.TUN_BRIDGE, + '10.0.0.1', self.NET_MAPPING, + 'sudo', 2, ['gre'], + self.VETH_MTU) + self.assertEqual(agent.agent_id, 'ovs-agent-%s' % cfg.CONF.host) self._verify_mock_calls() # TODO(ethuleau): Initially, local ARP responder is be dependent to the