diff --git a/lib/charms/redis_k8s/v0/redis.py b/lib/charms/redis_k8s/v0/redis.py index a731507..efef9ee 100644 --- a/lib/charms/redis_k8s/v0/redis.py +++ b/lib/charms/redis_k8s/v0/redis.py @@ -43,7 +43,8 @@ logger = logging.getLogger(__name__) -DEFAULT_REALTION_NAME = "redis" +DEFAULT_RELATION_NAME = "redis" + class RedisRelationUpdatedEvent(EventBase): """An event for the redis relation having been updated.""" @@ -56,7 +57,7 @@ class RedisRelationCharmEvents(CharmEvents): class RedisRequires(Object): - def __init__(self, charm, relation_name: str = DEFAULT_REALTION_NAME): + def __init__(self, charm, relation_name: str = DEFAULT_RELATION_NAME): """A class implementing the redis requires relation.""" super().__init__(charm, relation_name) self.framework.observe(charm.on[relation_name].relation_joined, self._on_relation_changed) @@ -109,7 +110,7 @@ def url(self) -> Optional[str]: class RedisProvides(Object): def __init__(self, charm, port): """A class implementing the redis provides relation.""" - super().__init__(charm, DEFAULT_REALTION_NAME) + super().__init__(charm, DEFAULT_RELATION_NAME) self.framework.observe(charm.on.redis_relation_changed, self._on_relation_changed) self._port = port self._charm = charm @@ -128,7 +129,7 @@ def _bind_address(self, event): relation = self.model.get_relation(event.relation.name, event.relation.id) if address := self.model.get_binding(relation).network.bind_address: return address - return self.app.name + return self._charm.app.name def _get_master_ip(self) -> str: """Gets the ip of the current redis master."""