lsn_id, lsn_port_id = self.manager.lsn_port_get(
context, network_id, subnet_id, raise_on_err=False)
else:
- subnet = self.validate(context, network_id)
- if subnet:
+ filters = {'network_id': [network_id]}
+ subnets = self.plugin.get_subnets(context, filters=filters)
+ if subnets:
lsn_id, lsn_port_id = self.manager.lsn_port_get(
- context, network_id, subnet['id'], raise_on_err=False)
+ context, network_id, subnets[0]['id'], raise_on_err=False)
else:
lsn_id = self.manager.lsn_get(context, network_id,
raise_on_err=False)
'services': ['foo_lsn_id'], 'type': 'lsn'})
def _test_report_for_lsn_without_subnet(self, validated_subnet):
- with mock.patch.object(self.manager, 'validate',
+ with mock.patch.object(self.manager.plugin, 'get_subnets',
return_value=validated_subnet):
self.manager.manager.lsn_port_get.return_value = (
('foo_lsn_id', 'foo_lsn_port_id'))
self.assertEqual(expected, report)
def test_report_for_lsn_without_subnet_subnet_found(self):
- self._test_report_for_lsn_without_subnet({'id': self.subnet_id})
+ self._test_report_for_lsn_without_subnet([{'id': self.subnet_id}])
def test_report_for_lsn_without_subnet_subnet_not_found(self):
self.manager.manager.lsn_get.return_value = 'foo_lsn_id'