Skip to content

Commit

Permalink
always raise exceptions on return codes 126 and 127
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Apr 5, 2018
1 parent e79bdc7 commit c9c3257
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bundlewrap/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ def run(
add_host_keys=False,
data_stdin=None,
ignore_failure=False,
raise_for_return_codes=(
126, # command not executable
127, # command not found
255, # SSH error
),
log_function=None,
wrapper_inner="{}",
wrapper_outer="{}",
Expand Down Expand Up @@ -233,7 +238,7 @@ def run(
result=force_text(result.stdout) + force_text(result.stderr),
)
io.debug(error_msg)
if not ignore_failure or result.return_code == 255:
if not ignore_failure or result.return_code in raise_for_return_codes:
raise RemoteException(error_msg)
return result

Expand Down

0 comments on commit c9c3257

Please sign in to comment.