Merge "Allow deleting user_creds when can't be decrypted"

This commit is contained in:
Zuul 2022-10-04 06:18:46 +00:00 committed by Gerrit Code Review
commit f71308319a
1 changed files with 4 additions and 2 deletions

View File

@ -1889,11 +1889,13 @@ class Stack(collections.abc.Mapping):
def _try_get_user_creds(self):
# There are cases where the user_creds cannot be returned
# due to credentials truncated when being saved to DB.
# Ignore this error instead of blocking stack deletion.
# Also, there are cases where auth_encryption_key has
# changed for some reason.
# Ignore these errors instead of blocking stack deletion.
try:
return ucreds_object.UserCreds.get_by_id(self.context,
self.user_creds_id)
except exception.Error:
except (exception.Error, exception.InvalidEncryptionKey):
LOG.exception("Failed to retrieve user_creds")
return None