diff --git a/src/charm.py b/src/charm.py index aebb7ea..5f88fb8 100755 --- a/src/charm.py +++ b/src/charm.py @@ -13,6 +13,7 @@ """ import logging +import time import ops from ops import ActiveStatus, SecretNotFoundError @@ -105,11 +106,13 @@ def set_secret(self, key: str, value: str) -> None: content.update({key: value}) logger.info(f"Setting secret {secret.id} to {content}") secret.set_content(content) + time.sleep(10) else: content = { key: value, } secret = self.app.add_secret(content) + time.sleep(10) self.app_peer_data["secret-id"] = secret.id logger.info(f"Added secret {secret.id} to {content}") @@ -130,6 +133,7 @@ def delete_secret(self, key: str) -> None: logger.info(f"Remaining content is {list(content.keys())}") if content: secret.set_content(content) + time.sleep(10) else: secret.remove_all_revisions() del self.app_peer_data["secret-id"]