Skip to content

Commit

Permalink
Happy linter happy life
Browse files Browse the repository at this point in the history
  • Loading branch information
alithethird committed Aug 6, 2024
1 parent c527903 commit 96b6181
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,16 @@ def _update_database(self, dry_run: bool = False) -> types_.ExecResult:
if dry_run:
cmd.append("--dry-run")

command_result = self._run_wp_cli(cmd, timeout=600)

result = self._run_wp_cli(cmd, timeout=600)
if result.return_code != 0:
return types_.ExecResult(
success=False,
result=None,
message=str(result.stderr) if result.stderr else "Database update failed",
)
logger.info("Finished Database update process.")
return types_.ExecResult(
success=bool(command_result.return_code == 0),
result=None,
message=(
command_result.stdout if command_result.return_code == 0 else command_result.stderr
),
success=True, result=None, message=str(result.stdout) if result.stdout else "ok"
)

@staticmethod
Expand Down

0 comments on commit 96b6181

Please sign in to comment.