Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Jan 5, 2024
1 parent 72ed4cf commit a5a1432
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/charms/mongos/v0/mongos_client_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _on_relation_changed(self, event) -> None:
if isinstance(new_extra_user_roles, str):
new_extra_user_roles = [new_extra_user_roles]

self.charm.set_user_role(new_extra_user_roles)
self.charm.set_user_roles(new_extra_user_roles)


class MongosRequirer(Object):
Expand All @@ -120,7 +120,7 @@ def __init__(
self.charm = charm

if not database_name:
database_name = f"{self.charm.app}-mongos"
database_name = f"{self.charm.app}"

self.database_requires = DatabaseRequires(
self.charm,
Expand Down
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def share_uri(self) -> None:
# TODO future PR - generate different URI for data-integrator as that charm will not
# communicate to mongos via the Unix Domain Socket.

def set_user_role(self, roles: List[str]) -> None:
def set_user_roles(self, roles: List[str]) -> None:
"""Updates the roles for the mongos user."""
roles_str = ",".join(roles)

Check warning on line 244 in src/charm.py

View check run for this annotation

Codecov / codecov/patch

src/charm.py#L244

Added line #L244 was not covered by tests
self.app_peer_data[USER_ROLES_TAG] = roles_str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _on_relation_changed(self, event) -> None:
if isinstance(new_extra_user_roles, str):
new_extra_user_roles = [new_extra_user_roles]

self.charm.set_user_role(new_extra_user_roles)
self.charm.set_user_roles(new_extra_user_roles)


class MongosRequirer(Object):
Expand All @@ -126,7 +126,7 @@ def __init__(
self.charm = charm

if not database_name:
database_name = f"{self.charm.app}-mongos"
database_name = f"{self.charm.app}"

self.database_requires = DatabaseRequires(
self.charm,
Expand Down

0 comments on commit a5a1432

Please sign in to comment.