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
This commit is contained in:
ramishra 2021-03-17 08:00:53 +05:30
parent 9f44451112
commit 6491e5aa04
1 changed files with 2 additions and 1 deletions

View File

@ -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)