Merge "Don't require heat client for generate_passwords"

This commit is contained in:
Zuul 2021-03-17 16:28:07 +00:00 committed by Gerrit Code Review
commit 90f52081ff
1 changed files with 21 additions and 19 deletions

View File

@ -62,11 +62,13 @@ def generate_passwords(swift=None, heat=None,
- otherwise, all passwords not in the DO_NOT_ROTATE list (as they require
special handling, like KEKs and Fernet keys) will be replaced.
"""
if heat is None:
raise RuntimeError('Should provide orchestration client to fetch'
'stack environment')
if rotate_pw_list is None:
rotate_pw_list = []
if heat is None:
stack_env = None
placement_extracted = False
else:
try:
stack_env = heat.stacks.environment(
stack_id=container)