ofagent: Fix an argument mismatch bug in commit 9d13ea88
recently merged commit 9d13ea884bff749b3975acb5eb5630e5aca4a665 had an argument mismatch bug which causes the following crash. TypeError: _get_ports() takes exactly 2 arguments (1 given) this commit fixes it. Closes-Bug: #1336175 Change-Id: I46bb1fc1aebf06274bb226014e4a9bc5a83f98ac
This commit is contained in:
parent
9eef0b349d
commit
a66c8df171
@ -1089,7 +1089,8 @@ class OFANeutronAgent(n_rpc.RpcCallback,
|
||||
|
||||
def treat_devices_added_or_updated(self, devices):
|
||||
resync = False
|
||||
all_ports = dict((p.port_name, p) for p in self._get_ports())
|
||||
all_ports = dict((p.port_name, p) for p in
|
||||
self._get_ports(self.int_br))
|
||||
for device in devices:
|
||||
LOG.debug(_("Processing port %s"), device)
|
||||
if device not in all_ports:
|
||||
|
@ -438,9 +438,10 @@ class TestOFANeutronAgent(OFAAgentTestCase):
|
||||
mock.patch.object(self.agent.plugin_rpc, 'update_device_up'),
|
||||
mock.patch.object(self.agent.plugin_rpc, 'update_device_down'),
|
||||
mock.patch.object(self.agent, func_name)
|
||||
) as (get_dev_fn, get_vif_func, upd_dev_up, upd_dev_down, func):
|
||||
) as (get_dev_fn, _get_ports, upd_dev_up, upd_dev_down, func):
|
||||
self.assertFalse(self.agent.treat_devices_added_or_updated(
|
||||
[port.port_name]))
|
||||
_get_ports.assert_called_once_with(self.agent.int_br)
|
||||
return func.called
|
||||
|
||||
def test_treat_devices_added_updated_ignores_invalid_ofport(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user