Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,11 @@ def set_mysql_router_rest_api_password(
self.create_router_rest_api_credentials_file()

if not password:
users_credentials = self._run_command(
[
self._mysql_router_password_command,
"list",
str(self.rest_api_credentials_file),
],
timeout=30,
)
users_credentials = self._run_command([
self._mysql_router_password_command,
"list",
str(self.rest_api_credentials_file),
])
if user not in users_credentials:
return

Expand All @@ -242,5 +239,4 @@ def set_mysql_router_rest_api_password(
user,
],
input=password,
timeout=30,
)
2 changes: 1 addition & 1 deletion src/rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _run_command(
self,
command: typing.List[str],
*,
timeout: typing.Optional[int],
timeout: typing.Optional[int] = 15,
input: str = None, # noqa: A002 Match subprocess.run()
) -> str:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _bootstrap_router(self, *, event, tls: bool) -> None:

command = self._get_bootstrap_command(event=event, connection_info=self._connection_info)
try:
self._container.run_mysql_router(command, timeout=30)
self._container.run_mysql_router(command)
except container.CalledProcessError as e:
# Original exception contains password
# Re-raising would log the password to Juju's debug log
Expand Down
Loading