Require more specific exception

This is follow-up of 1e683483e7 and
replaces the generic Exception asserted in a unit tests by the specific
castellan exception, according to the 4.4.0 release.

This change does not bump minimum required version of castellan because
the version requirement only affects unit tests.

Depends-on: https://review.opendev.org/c/openstack/requirements/+/911059
Change-Id: Id1ed909f179038713d9da2fd72cf39e7fb7c8dfe
This commit is contained in:
Takashi Kajinami 2024-03-05 13:58:41 +09:00
parent cd881124ca
commit 211fdbab28
1 changed files with 1 additions and 3 deletions

View File

@ -3877,9 +3877,7 @@ class TestImagesController(base.IsolatedUnitTest):
virtual_size=3072, extra_properties=props)
self.controller._delete_encryption_key(request.context, image)
# Make sure the encryption key is gone
# TODO(tkajinam): Replace Exception by ManagedObjectNotFoundError once
# castellan in u-c is bumped to 4.4.0
self.assertRaises(Exception, # noqa
self.assertRaises(castellan_exception.ManagedObjectNotFoundError,
self.controller._key_manager.get,
request.context, fake_encryption_key)