Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Dec 11, 2023
1 parent ac7869d commit 4dd09cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def share_uri(self) -> None:

def set_user_role(self, roles: List[str]):
"""Updates the roles for the mongos user."""
roles = roles.join(",")
self.app_peer_data[USER_ROLES_TAG] = roles
roles_str = roles.join(",")
self.app_peer_data[USER_ROLES_TAG] = roles_str

if len(self.model.relations[Config.Relations.CLUSTER_RELATIONS_NAME]) == 0:
return
Expand All @@ -249,7 +249,9 @@ def set_user_role(self, roles: List[str]):
config_server_rel = self.model.relations[
Config.Relations.CLUSTER_RELATIONS_NAME
][0]
self.cluster.update_relation_data(config_server_rel.id, {USER_ROLES_TAG: roles})
self.cluster.update_relation_data(
config_server_rel.id, {USER_ROLES_TAG: roles_str}
)

def set_database(self, database: str):
"""Updates the database requested for the mongos user."""
Expand Down

0 comments on commit 4dd09cb

Please sign in to comment.