From ac44c36e4f6b450da7b6c0b3f915a235e167a015 Mon Sep 17 00:00:00 2001 From: Dietmar Schinnerl Date: Sat, 11 Aug 2012 16:57:04 +0200 Subject: [PATCH] Removed unnecessary string replacements since parse_json already filters garbage lines --- lib/ansible/runner/connection/ssh.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/runner/connection/ssh.py b/lib/ansible/runner/connection/ssh.py index aaf429c54f..51195aa1f3 100644 --- a/lib/ansible/runner/connection/ssh.py +++ b/lib/ansible/runner/connection/ssh.py @@ -60,7 +60,7 @@ class SSHConnection(object): ssh_cmd = ["ssh", "-tt", "-q"] + self.common_args + [self.host] if self.runner.sudo and sudoable: # Rather than detect if sudo wants a password this time, -k makes - # sudo always ask for a password if one is required. + # sudo always ask for a password if one is required. # Passing a quoted compound command to sudo (or sudo -s) # directly doesn't work, so we shellquote it with pipes.quote() # and pass the quoted string to the user's shell. We loop reading @@ -104,10 +104,6 @@ class SSHConnection(object): if p.stdout in rfd: stdout += os.read(p.stdout.fileno(), 1024) p.stdin.close() # close stdin after we read from stdout (see also issue #848) - # older versions of ssh generate this error which we ignore - stdout=stdout.replace("tcgetattr: Invalid argument\n", "") - # suppress Ubuntu 10.04/12.04 error on -tt option - stdout=stdout.replace("tcgetattr: Inappropriate ioctl for device\n","") if p.returncode != 0 and stdout.find('Bad configuration option: ControlPersist') != -1: raise errors.AnsibleError('using -c ssh on certain older ssh versions may not support ControlPersist, set ANSIBLE_SSH_ARGS="" before running again')