A bit more debugging output

We used to display input chunks earlier anyway, so this isn't making
things more verbose.
This commit is contained in:
Abhijit Menon-Sen 2015-09-23 22:35:14 +05:30
parent 9700d9c04f
commit 40f608a377

View file

@ -465,14 +465,14 @@ class Connection(ConnectionBase):
if chunk == '': if chunk == '':
rpipes.remove(p.stdout) rpipes.remove(p.stdout)
tmp_stdout += chunk tmp_stdout += chunk
#self._display.debug("stdout chunk (state=%s):\n>>>%s<<<\n" % (state, chunk)) self._display.debug("stdout chunk (state=%s):\n>>>%s<<<\n" % (state, chunk))
if p.stderr in rfd: if p.stderr in rfd:
chunk = p.stderr.read() chunk = p.stderr.read()
if chunk == '': if chunk == '':
rpipes.remove(p.stderr) rpipes.remove(p.stderr)
tmp_stderr += chunk tmp_stderr += chunk
#self._display.debug("stderr chunk (state=%s):\n>>>%s<<<\n" % (state, chunk)) self._display.debug("stderr chunk (state=%s):\n>>>%s<<<\n" % (state, chunk))
# We examine the output line-by-line until we have negotiated any # We examine the output line-by-line until we have negotiated any
# privilege escalation prompt and subsequent success/error message. # privilege escalation prompt and subsequent success/error message.
@ -578,7 +578,7 @@ class Connection(ConnectionBase):
just hang forever waiting for more commands.) just hang forever waiting for more commands.)
''' '''
self._display.debug('Sending initial data (%d bytes)' % len(in_data)) self._display.debug('Sending initial data')
try: try:
fh.write(in_data) fh.write(in_data)
@ -586,6 +586,8 @@ class Connection(ConnectionBase):
except (OSError, IOError): except (OSError, IOError):
raise AnsibleConnectionFailure('SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh') raise AnsibleConnectionFailure('SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh')
self._display.debug('Sent initial data (%d bytes)' % len(in_data))
# This is a separate method because we need to do the same thing for stdout # This is a separate method because we need to do the same thing for stdout
# and stderr. # and stderr.