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 @@ -228,14 +228,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 @@ -248,5 +245,4 @@ def set_mysql_router_rest_api_password(
user,
],
input=password,
timeout=30,
)
2 changes: 1 addition & 1 deletion src/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _run_command(
self,
command: typing.List[str],
*,
timeout: typing.Optional[int],
timeout: typing.Optional[int] = 30,
input: str = None, # noqa: A002 Match subprocess.run()
) -> str:
try:
Expand Down
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -327,7 +327,7 @@ def _restart(self, *, event, tls: bool) -> None:

def _enable_router(self, *, event, tls: bool, unit_name: str) -> None:
"""Enable router after setting up all the necessary prerequisites."""
logger.debug("Enabling MySQL Router service")
logger.info("Enabling MySQL Router service")
self._cleanup_after_upgrade_or_potential_container_restart()
# create an empty credentials file, if the file does not exist
self._container.create_router_rest_api_credentials_file()
Expand All @@ -337,7 +337,7 @@ def _enable_router(self, *, event, tls: bool, unit_name: str) -> None:
)
self._container.update_mysql_router_service(enabled=True, tls=tls)
self._logrotate.enable()
logger.debug("Enabled MySQL Router service")
logger.info("Enabled MySQL Router service")
self._charm.wait_until_mysql_router_ready(event=event)

def _enable_exporter(
Expand Down
Loading