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
1 change: 1 addition & 0 deletions webhook_server_container/libs/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,7 @@ def fix_podman_bug(self) -> None:

def run_podman_command(self, command: str, pipe: bool = False) -> Tuple[bool, str, str]:
rc, out, err = run_command(command=command, log_prefix=self.log_prefix, pipe=pipe)

if rc:
return rc, out, err

Expand Down
10 changes: 7 additions & 3 deletions webhook_server_container/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run_command(
check: bool = False,
pipe: bool = False,
**kwargs: Any,
) -> Tuple[bool, str, str]:
) -> Tuple[bool, Any, Any]:
"""
Run command locally.

Expand Down Expand Up @@ -111,8 +111,12 @@ def run_command(
timeout=timeout,
**kwargs,
)
out_decoded = sub_process.stdout.decode() if isinstance(sub_process.stdout, bytes) else sub_process.stdout
err_decoded = sub_process.stderr.decode() if isinstance(sub_process.stderr, bytes) else sub_process.stderr
out_decoded = (
sub_process.stdout.decode(errors="ignore") if isinstance(sub_process.stdout, bytes) else sub_process.stdout
)
err_decoded = (
sub_process.stderr.decode(errors="ignore") if isinstance(sub_process.stderr, bytes) else sub_process.stderr
)

error_msg = (
f"{log_prefix} Failed to run '{command}'. "
Expand Down