diff --git a/lib/charms/mongodb/v1/helpers.py b/lib/charms/mongodb/v1/helpers.py index d07aff9d9..16ce2e538 100644 --- a/lib/charms/mongodb/v1/helpers.py +++ b/lib/charms/mongodb/v1/helpers.py @@ -150,7 +150,7 @@ def get_mongos_args( cmd.extend( [ "--clusterAuthMode=keyFile", - f"--keyFile={KEY_FILE}", + f"--keyFile={full_conf_dir}/{KEY_FILE}", ] ) diff --git a/lib/charms/mongodb/v1/shards_interface.py b/lib/charms/mongodb/v1/shards_interface.py index 552183130..5431b4dff 100644 --- a/lib/charms/mongodb/v1/shards_interface.py +++ b/lib/charms/mongodb/v1/shards_interface.py @@ -464,8 +464,8 @@ def cluster_password_synced(self) -> bool: return False raise except ServerSelectionTimeoutError as e: - # Connection refused, - this occurs when internal membership via TLS is not in sync - # across the cluster. + # Connection refused, - this occurs when internal membership is not in sync across the + # cluster (i.e. TLS + KeyFile). if e.code == 111: return False raise @@ -952,6 +952,12 @@ def _is_added_to_cluster(self) -> bool: return False raise + except ServerSelectionTimeoutError as e: + # Connection refused, - this occurs when internal membership is not in sync across the + # cluster (i.e. TLS + KeyFile). + if e.code == 111: + return False + raise def cluster_password_synced(self) -> bool: """Returns True if the cluster password is synced for the shard.""" @@ -973,8 +979,8 @@ def cluster_password_synced(self) -> bool: return False raise except ServerSelectionTimeoutError as e: - # Connection refused, - this occurs when internal membership via TLS is not in sync - # across the cluster. + # Connection refused, - this occurs when internal membership is not in sync across the + # cluster (i.e. TLS + KeyFile). if e.code == 111: return False raise