Skip to content

Commit 30021c7

Browse files
committed
Change exit code in run method
1 parent 63a9e59 commit 30021c7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
__pycache__/
44
build/
55
dist/
6-
sshcontroller_oroques.egg-info/
6+
sshcontroller.egg-info/

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="sshcontroller",
8-
version="1.0",
8+
version="1.1",
99
author="Olivier Roques",
1010
author_email="[email protected]",
1111
description="A package to easily run SSH commands",

sshcontroller/sshcontroller.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ def __run_until_event(
160160
break
161161

162162
channel.close()
163-
return (channel.exit_status_ready(), output.splitlines())
163+
164+
if not channel.exit_status_ready():
165+
return (0, output.splitlines())
166+
167+
return (channel.recv_exit_status(), output.splitlines())
164168

165169
def __run_until_exit(
166170
self,

0 commit comments

Comments
 (0)