diff options
author | ramishra <ramishra@redhat.com> | 2021-03-16 10:02:47 +0530 |
---|---|---|
committer | Takashi Kajinami <tkajinam@redhat.com> | 2022-11-17 12:13:14 +0900 |
commit | 5466ede853bde7d636943cba017ed8265dcfd260 (patch) | |
tree | 0d16259bcebb88df210858322f170243a38e832d | |
parent | 2d0f0aed39fa9410eb294426d172d38d342bb37d (diff) | |
download | heat-ussuri-eol.tar.gz |
Allow deleting user_creds when can't be decryptedussuri-eol
There are situations when the auth_encryption_key changes
and customer wants to delete old stacks. We should allow
deleting those stacks.
Task: #42055
Change-Id: Ifc8c19e181902566d4f295fa979ab6869a4e0852
(cherry picked from commit 520e2389d3123efc9269bbf82c6c9998b6c62564)
(cherry picked from commit c3a8e3d64ebb37ab83b3cebb868cd68d4135f59d)
(cherry picked from commit c37ec5180cefbc992640bdb2e80ed67b92dc5664)
(cherry picked from commit 8d609ba98c9365fb089d5a98e3980ad9f5214946)
(cherry picked from commit 15667ccb3da902f1a653b14c81719446436214a6)
-rw-r--r-- | heat/engine/stack.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/heat/engine/stack.py b/heat/engine/stack.py index 801fce0a0..6b51ea049 100644 --- a/heat/engine/stack.py +++ b/heat/engine/stack.py @@ -1840,11 +1840,13 @@ class Stack(collections.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 |