mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/ssh.py: Make SshConnection._background() more robust
Raise a better exception when e.g. sudo command is not found.
This commit is contained in:
parent
2b38548463
commit
728b59ad7e
@ -583,7 +583,20 @@ class SshConnection(SshConnectionBase):
|
|||||||
timeout=None,
|
timeout=None,
|
||||||
executor=executor,
|
executor=executor,
|
||||||
)
|
)
|
||||||
pid = int(stdout_in.readline())
|
pid = stdout_in.readline()
|
||||||
|
if not pid:
|
||||||
|
stderr = stderr_in.read()
|
||||||
|
if channel.exit_status_ready():
|
||||||
|
ret = channel.recv_exit_status()
|
||||||
|
else:
|
||||||
|
ret = 126
|
||||||
|
raise subprocess.CalledProcessError(
|
||||||
|
ret,
|
||||||
|
command,
|
||||||
|
b'',
|
||||||
|
stderr,
|
||||||
|
)
|
||||||
|
pid = int(pid)
|
||||||
|
|
||||||
def create_out_stream(stream_in, stream_out):
|
def create_out_stream(stream_in, stream_out):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user