![Nishant Kumar](/assets/img/avatar_default.png)
More details on this bug - https://bugs.launchpad.net/maas/+bug/1850180 Change-Id: I52312ccec74a1973fdb7aebe3bfc6c0088004ad5
21 lines
896 B
Diff
21 lines
896 B
Diff
diff --git a/src/maasserver/security.py b/src/maasserver/security.py
|
|
index e931b89..44fad1a 100644
|
|
--- a/src/maasserver/security.py
|
|
+++ b/src/maasserver/security.py
|
|
@@ -105,10 +105,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
|
|
|