Merge "Scan for mac through all devices" into stable/newton
This commit is contained in:
commit
af363f521b
|
@ -725,8 +725,10 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
|
|||
list(self.bridge_mappings.values())[0])
|
||||
else:
|
||||
devices = ip_lib.IPWrapper().get_devices(True)
|
||||
if devices:
|
||||
mac = utils.get_interface_mac(devices[0].name)
|
||||
for device in devices:
|
||||
mac = utils.get_interface_mac(device.name)
|
||||
if mac:
|
||||
break
|
||||
else:
|
||||
LOG.error(_LE("Unable to obtain MAC address for unique ID. "
|
||||
"Agent terminated!"))
|
||||
|
|
|
@ -880,11 +880,11 @@ class TestLinuxBridgeManager(base.BaseTestCase):
|
|||
mock.patch.object(
|
||||
utils,
|
||||
"get_interface_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…
Reference in New Issue