Do not rotate keys when lead unit is paused

Closes-Bug: #1787719
Change-Id: I0557803e90d8ec52271f01e5e7276d2db8338ce2
This commit is contained in:
Frode Nordahl 2018-08-20 09:37:09 +02:00
parent e472adaf2f
commit 93db018485
1 changed files with 4 additions and 0 deletions

View File

@ -2050,6 +2050,10 @@ def fernet_keys_rotate_and_sync(log_func=log):
"""
if not keystone_context.fernet_enabled() or not is_leader():
return
if is_unit_paused_set():
log_func("Fernet key rotation requested but unit is paused",
level=INFO)
return
# now see if the keys need to be rotated
try:
last_rotation = os.stat(