mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Because paramiko using a pty can't distinguish stderr and stdout, remove handling that
treated -D as a way to show stderr, and make sure modules don't include things on stderr. Update docs and test module script to come into line.
This commit is contained in:
parent
076f1bc169
commit
36e454c52f
10 changed files with 47 additions and 54 deletions
|
@ -637,16 +637,18 @@ class Runner(object):
|
|||
''' execute a command string over SSH, return the output '''
|
||||
|
||||
stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudoable=sudoable)
|
||||
|
||||
err=None
|
||||
out=None
|
||||
if type(stderr) != str:
|
||||
err="\n".join(stderr.readlines())
|
||||
else:
|
||||
err=stderr
|
||||
|
||||
if type(stdout) != str:
|
||||
return "\n".join(stdout.readlines()), err
|
||||
out="\n".join(stdout.readlines())
|
||||
else:
|
||||
return stdout, err
|
||||
out=stdout
|
||||
return (out,err)
|
||||
|
||||
|
||||
# *****************************************************
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue