Skip to content

Commit f59a33d

Browse files
committed
shell: fix returncode that can be None in shell
Subprocess return code can be None, so we ensure that shell is returning a -1 when this happens. Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
1 parent 03730c0 commit f59a33d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libkirk/channels/shell.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ async def run_command(
203203
ret = {
204204
"command": command,
205205
"stdout": stdout,
206-
"returncode": proc.returncode,
206+
"returncode": proc.returncode
207+
if proc.returncode is not None
208+
else -1,
207209
"exec_time": t_end,
208210
}
209211

0 commit comments

Comments
 (0)