From 6491e5aa04d6e6655160d1bc5702c8746ff1d7da Mon Sep 17 00:00:00 2001 From: ramishra Date: Wed, 17 Mar 2021 08:00:53 +0530 Subject: [PATCH] Don't allow rotating keys if stack not found In Ic2769b69bf4b34669886dde1ef663d561d9e6173 we changed to use stack env for key rotattion. There is a regression, as we proceed when stack is not found resulting in an AttributeError. Change-Id: Ibb9323ee2777dbef84c5cdbc124d4abd34b34dba --- tripleo_common/utils/plan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tripleo_common/utils/plan.py b/tripleo_common/utils/plan.py index 8d121343c..f9a40f5c6 100644 --- a/tripleo_common/utils/plan.py +++ b/tripleo_common/utils/plan.py @@ -114,7 +114,8 @@ def rotate_fernet_keys(heat, stack_env = heat.stacks.environment( stack_id=container) except heat_exc.HTTPNotFound: - stack_env = None + raise RuntimeError('Can not rotate fernet keys without an' + 'existing stack %s.' % container) parameter_defaults = stack_env.get('parameter_defaults', {}) passwords = get_overriden_passwords({}, parameter_defaults)