diff --git a/src/maasserver/security.py b/src/maasserver/security.py index f92529265..542970009 100644 --- a/src/maasserver/security.py +++ b/src/maasserver/security.py @@ -97,11 +97,11 @@ def get_shared_secret_txn(): elif secret_in_db == secret_on_fs: secret = secret_in_db # or secret_on_fs. else: - raise AssertionError( - "The secret stored in the database does not match the secret " - "stored on the filesystem at %s. Please investigate." - % get_shared_secret_filesystem_path() - ) + # (nk613n): When we rotate secrets we only update the filesystem + # so if the secrets don't match we will default to the FS + # secret and set it in the database (set_config function) + secret = secret_on_fs + Config.objects.set_config("rpc_shared_secret", to_hex(secret)) return secret