Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
fix: #161 case, when error not happens
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Jan 18, 2022
1 parent 5309da1 commit 68ac6fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bahub/bahub/transports/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ def has_exited_with_success(self) -> bool:

errors = yaml.load(self._process.read_channel(ERROR_CHANNEL), yaml.FullLoader)

if "details" in errors:
if errors and "details" in errors:
for error in errors['details']['causes']:
if "reason" not in error:
self._io.error(error['message'])
return True
return False

if error['reason'] == 'ExitCode' and int(error['message']) > 0:
self._io.error(f"Process inside POD exited with status {int(error['message'])}")
return True
return False

return False
return True


def pod_exec(pod_name: str, namespace: str, cmd: List[str], io: IO) -> ExecResult:
Expand Down

0 comments on commit 68ac6fe

Please sign in to comment.