From 84dcf995771e152b295c08553ed3ac0278f98129 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Mon, 23 Sep 2024 17:10:43 +0000 Subject: [PATCH] Modify method to not be private --- src/machine_charm.py | 2 +- src/relations/hacluster.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine_charm.py b/src/machine_charm.py index 7bb75d4..788823b 100755 --- a/src/machine_charm.py +++ b/src/machine_charm.py @@ -88,7 +88,7 @@ def host_address(self) -> str: """The host address for the machine.""" if ( self._ha_cluster.relation - and self._ha_cluster._is_clustered() + and self._ha_cluster.is_clustered() and self.config.get("vip") ): return self.config["vip"] diff --git a/src/relations/hacluster.py b/src/relations/hacluster.py index 70b076e..8f4b84f 100644 --- a/src/relations/hacluster.py +++ b/src/relations/hacluster.py @@ -34,7 +34,7 @@ def relation(self) -> Optional[ops.Relation]: """Returns the relations in this model, or None if hacluster is not initialised.""" return self.charm.model.get_relation(HACLUSTER_RELATION_NAME) - def _is_clustered(self) -> bool: + def is_clustered(self) -> bool: """Check if the related hacluster charm is clustered.""" for key, value in self.relation.data.items(): if ( @@ -69,7 +69,7 @@ def set_vip(self, vip: Optional[str]) -> None: if not self.relation: return - if not self._is_clustered(): + if not self.is_clustered(): logger.debug("early exit set_vip: ha relation not yet clustered") return