Merge "NSX: do not raise on missing router during migration step"
This commit is contained in:
commit
6d1fc33534
@ -58,8 +58,6 @@ class DhcpMetadataBuilder(object):
|
|||||||
for port in ports:
|
for port in ports:
|
||||||
if port['fixed_ips'][0]['subnet_id'] == subnet['id']:
|
if port['fixed_ips'][0]['subnet_id'] == subnet['id']:
|
||||||
return port['device_id']
|
return port['device_id']
|
||||||
else:
|
|
||||||
raise n_exc.NotFound()
|
|
||||||
|
|
||||||
def metadata_deallocate(self, context, router_id, subnet_id):
|
def metadata_deallocate(self, context, router_id, subnet_id):
|
||||||
"""Deallocate metadata services for the subnet."""
|
"""Deallocate metadata services for the subnet."""
|
||||||
|
@ -71,6 +71,11 @@ class DhcpMetadataBuilderTestCase(base.BaseTestCase):
|
|||||||
def test_router_id_get_none_subnet(self):
|
def test_router_id_get_none_subnet(self):
|
||||||
self.assertIsNone(self.builder.router_id_get(mock.ANY, None))
|
self.assertIsNone(self.builder.router_id_get(mock.ANY, None))
|
||||||
|
|
||||||
|
def test_router_id_get_none_no_router(self):
|
||||||
|
self.builder.plugin.get_ports.return_value = []
|
||||||
|
subnet = {'network_id': self.network_id}
|
||||||
|
self.assertIsNone(self.builder.router_id_get(mock.ANY, subnet))
|
||||||
|
|
||||||
def test_metadata_deallocate(self):
|
def test_metadata_deallocate(self):
|
||||||
self.builder.metadata_deallocate(
|
self.builder.metadata_deallocate(
|
||||||
mock.ANY, self.router_id, self.subnet_id)
|
mock.ANY, self.router_id, self.subnet_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user