Ignore resource_data decryption errors

If the auth_encryption_key changes We can possibly
ignore these errors when deleting stacks.

Task: 42056
Change-Id: I326e415db194a5b9c67acd038d7d2d993293ecb3
This commit is contained in:
ramishra 2021-03-16 12:19:26 +05:30 committed by rabi
parent ceef7869e0
commit 9407b4897e

View File

@ -387,9 +387,14 @@ def resource_data_get_all(context, resource_id, data=None):
for res in data:
if res.redact:
ret[res.key] = crypt.decrypt(res.decrypt_method, res.value)
else:
ret[res.key] = res.value
try:
ret[res.key] = crypt.decrypt(res.decrypt_method, res.value)
continue
except exception.InvalidEncryptionKey:
LOG.exception('Failed to decrypt resource data %(rkey)s '
'for %(rid)s, ignoring.',
{'rkey': res.key, 'rid': resource_id})
ret[res.key] = res.value
return ret