Skip to content

Commit

Permalink
Resolve review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Ratushnyy authored and dmitry-ratushnyy committed Sep 13, 2023
1 parent f3642d9 commit 8b0d5ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ def _juju_secrets_get(self, scope: Scopes) -> Optional[bool]:
return False

def _juju_secret_get(self, scope: Scopes, key: str) -> Optional[str]:
"""Helper function to get Juju secret."""
if not key:
return

Expand Down
8 changes: 2 additions & 6 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ async def find_unit(ops_test: OpsTest, leader: bool, app=APP_NAME) -> ops.model.

async def get_leader_id(ops_test: OpsTest) -> int:
"""Returns the unit number of the juju leader unit."""
leader_unit_id = 0
for unit in ops_test.model.applications[APP_NAME].units:
if await unit.is_leader_from_status():
return leader_unit_id

leader_unit_id += 1

return leader_unit_id
return int(unit.name.split("/")[1])
return -1


async def set_password(
Expand Down

0 comments on commit 8b0d5ef

Please sign in to comment.