Do no recreate fernet tokens on setup

In case of keystone-fernet-setup job rerun (delete and create),
fernet tokens are recreated. Which leads to ongoing openstack request
fail.

keystone-manage fernet_setup is idempotent, let's make the
keystone-fernet-setup job idempotent as well.

Change-Id: I62e741fe5192b7a0018bc84ccdac1ea5311a1e03
This commit is contained in:
Andrey Volkov 2019-12-06 13:38:22 +03:00
parent 52c132b935
commit 8957bacb4a

View File

@ -152,9 +152,9 @@ def main():
FERNET_DIR) FERNET_DIR)
write_to_files(secret['data']) write_to_files(secret['data'])
if args.command == 'credential_setup': if args.command in ('credential_setup', 'fernet_setup'):
if secret.get('data', False): if secret.get('data', False):
LOG.info('Credential keys already exist, skipping setup...') LOG.info('Keys already exist, skipping setup...')
sys.exit(0) sys.exit(0)
execute_command(args.command) execute_command(args.command)