diff --git a/common/ssh_client/remote_client.py b/common/ssh_client/remote_client.py index 5516324a..311aa785 100644 --- a/common/ssh_client/remote_client.py +++ b/common/ssh_client/remote_client.py @@ -84,7 +84,8 @@ def exec_cmd(self, cmd): self.stdio.verbose("use remote_client_sudo") stdin, stdout, stderr = self._ssh_fd.exec_command("sudo -n true") if stderr: - raise Exception(stderr.read().decode('utf-8')) + if len(stderr.read().decode('utf-8').strip())> 0: + raise Exception(stderr.read().decode('utf-8')) cmd = "sudo {0}".format(cmd) stdin, stdout, stderr = self._ssh_fd.exec_command(cmd) err_text = stderr.read()