Merge "Scan for mac through all devices"
This commit is contained in:
commit
55d3c9a79d
neutron
plugins/ml2/drivers/linuxbridge/agent
tests/unit/plugins/ml2/drivers/linuxbridge/agent
@ -716,8 +716,10 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
|
||||
list(self.bridge_mappings.values())[0])
|
||||
else:
|
||||
devices = ip_lib.IPWrapper().get_devices(True)
|
||||
if devices:
|
||||
mac = ip_lib.get_device_mac(devices[0].name)
|
||||
for device in devices:
|
||||
mac = ip_lib.get_device_mac(device.name)
|
||||
if mac:
|
||||
break
|
||||
else:
|
||||
LOG.error(_LE("Unable to obtain MAC address for unique ID. "
|
||||
"Agent terminated!"))
|
||||
|
@ -872,11 +872,11 @@ class TestLinuxBridgeManager(base.BaseTestCase):
|
||||
mock.patch.object(
|
||||
ip_lib,
|
||||
"get_device_mac",
|
||||
return_value='16:63:69:10:a0:59') as mock_gim:
|
||||
side_effect=[None, '16:63:69:10:a0:59']) as mock_gim:
|
||||
|
||||
agent_id = lbm.get_agent_id()
|
||||
self.assertEqual("lb16636910a059", agent_id)
|
||||
mock_gim.assert_called_with("eth1")
|
||||
mock_gim.assert_has_calls([mock.call("eth1"), mock.call("eth2")])
|
||||
|
||||
|
||||
class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user