Skip to content

Commit

Permalink
Merge branch 'master' into latest
Browse files Browse the repository at this point in the history
	# Please enter a commit message to explain why this merge is necessary,
  • Loading branch information
Nguyen Huu Thuong committed Mar 5, 2021
2 parents 6582a0b + c9b539a commit 78e864b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def ssh_process(ssh, input_ssh):

stdin, stdout, stderr = ssh.exec_command(command_str)

ssh_exit_status = stdout.channel.recv_exit_status()

out = "".join(stdout.readlines())
out = out.strip() if out is not None else None
if out:
Expand All @@ -107,6 +109,9 @@ def ssh_process(ssh, input_ssh):
err = err.strip() if err is not None else None
if err:
print(f"Error: \n{err}")

if ssh_exit_status != 0:
print(f"ssh exit status: {ssh_exit_status}")
sys.exit(1)

pass
Expand Down

0 comments on commit 78e864b

Please sign in to comment.