Merge "Handle listener not found during loadbalancer status update"
This commit is contained in:
commit
bc8f281071
@ -1148,6 +1148,9 @@ class ListenerRepository(BaseRepository):
|
||||
resource.tags = tags
|
||||
listener_db = session.query(self.model_class).filter_by(
|
||||
id=id).first()
|
||||
if not listener_db:
|
||||
raise exceptions.NotFound(
|
||||
resource=data_models.Listener._name(), id=id)
|
||||
# Verify any newly specified default_pool_id exists
|
||||
default_pool_id = model_kwargs.get('default_pool_id')
|
||||
if default_pool_id:
|
||||
|
@ -2952,6 +2952,10 @@ class TestListenerRepositoryTest(BaseRepositoryTest):
|
||||
new_listener = self.listener_repo.get(self.session, id=listener.id)
|
||||
self.assertIn(container1_dm, new_listener.sni_containers)
|
||||
|
||||
def test_update_bad_id(self):
|
||||
self.assertRaises(exceptions.NotFound, self.listener_repo.update,
|
||||
self.session, id=uuidutils.generate_uuid())
|
||||
|
||||
def test_delete(self):
|
||||
listener = self.create_listener(self.FAKE_UUID_1, 80)
|
||||
self.listener_repo.delete(self.session, id=listener.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user