Removed unnecessary string replacements since parse_json already filters garbage lines

pull/851/head
Dietmar Schinnerl 12 years ago
parent 6b622beb4d
commit ac44c36e4f

@ -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')

Loading…
Cancel
Save