diff --git a/lib/charms/mongodb/v0/config_server_interface.py b/lib/charms/mongodb/v0/config_server_interface.py index 1b5b3b897..0f7d2351f 100644 --- a/lib/charms/mongodb/v0/config_server_interface.py +++ b/lib/charms/mongodb/v0/config_server_interface.py @@ -373,7 +373,7 @@ def is_mongos_running(self) -> bool: connection_uri = f"mongodb://{self.charm.get_mongos_host()}" # use the mongos port for k8s charms and external connections on VM - if self.charm.is_external_client or self.substrate == Config.K8S_SUBSTRATE: + if self.substrate == Config.K8S_SUBSTRATE or self.charm.is_external_client: connection_uri = connection_uri + f":{Config.MONGOS_PORT}" with MongosConnection(None, connection_uri) as mongo: diff --git a/lib/charms/mongodb/v1/mongodb_provider.py b/lib/charms/mongodb/v1/mongodb_provider.py index 8fee64c0f..ec9de773b 100644 --- a/lib/charms/mongodb/v1/mongodb_provider.py +++ b/lib/charms/mongodb/v1/mongodb_provider.py @@ -51,7 +51,7 @@ class MongoDBProvider(Object): """In this class, we manage client database relations.""" - def __init__(self, charm: CharmBase, substrate="k8s", relation_name: str = "database") -> None: + def __init__(self, charm: CharmBase, substrate="k8s", relation_name: str = REL_NAME) -> None: """Constructor for MongoDBProvider object. Args: