diff --git a/spug_api/libs/ssh.py b/spug_api/libs/ssh.py index 3ea87cdf..50db0309 100644 --- a/spug_api/libs/ssh.py +++ b/spug_api/libs/ssh.py @@ -82,6 +82,8 @@ def exec_command_with_stream(self, command, environment=None): exit_code, line = -1, '' while True: line = channel.recv(8196).decode() + if not line: + break match = self.regex.search(line) if match: exit_code = int(line.rsplit()[-1])