From cf11703556001df8ddb87ba5cdcbe8445876861e Mon Sep 17 00:00:00 2001 From: Mia Altieri <32723809+MiaAltieri@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:44:29 +0200 Subject: [PATCH] Fix incorrect Adding shard to config-server status (#497) Co-authored-by: Neha Oudin <17551419+Gu1nness@users.noreply.github.com> --- lib/charms/mongodb/v1/shards_interface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/charms/mongodb/v1/shards_interface.py b/lib/charms/mongodb/v1/shards_interface.py index 9be6c8a41..ae6f9e8f1 100644 --- a/lib/charms/mongodb/v1/shards_interface.py +++ b/lib/charms/mongodb/v1/shards_interface.py @@ -58,7 +58,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 10 +LIBPATCH = 11 KEYFILE_KEY = "key-file" HOSTS_KEY = "host" @@ -557,7 +557,7 @@ def __init__( super().__init__(charm, self.relation_name) self.framework.observe( - charm.on[self.relation_name].relation_joined, self._on_relation_joined + charm.on[self.relation_name].relation_created, self.relation_created ) self.framework.observe( charm.on[self.relation_name].relation_changed, self._on_relation_changed @@ -687,7 +687,7 @@ def sync_cluster_passwords( # after updating the password of the backup user, restart pbm with correct password self.charm._connect_pbm_agent() - def _on_relation_joined(self, event: RelationJoinedEvent): + def relation_created(self, event: RelationJoinedEvent): """Sets status and flags in relation data relevant to sharding.""" # if re-using an old shard, re-set flags. self.charm.unit_peer_data["drained"] = json.dumps(False)