Lee Hughes
2014-11-10 21:10:15 UTC
Hi I'm new to Fabric and am having trouble separating stderr from stdout.
[localhost] out: /bin/bash: somebadcommand: command not found
[localhost] out:
Warning: run() received nonzero return code 127 while executing
'somebadcommand'!
[localhost] out: /bin/bash: somebadcommand: command not found
[localhost] out:
Warning: run() received nonzero return code 127 while executing
'somebadcommand'!
âI expected the second attempt to return stderr to result.stderr instead of
result.stdoutâ
Any help would be greatly appreciated.
Thanks-
Lee
from fabric.api import *
env.host_string = 'localhost'
env.port = 22
env.username = 'myusername'
env.password = 'mypassword'
env.warn_only = True
result = run('somebadcommand')
[localhost] run: somebadcommandenv.host_string = 'localhost'
env.port = 22
env.username = 'myusername'
env.password = 'mypassword'
env.warn_only = True
result = run('somebadcommand')
[localhost] out: /bin/bash: somebadcommand: command not found
[localhost] out:
Warning: run() received nonzero return code 127 while executing
'somebadcommand'!
result.stdout
'/bin/bash: somebadcommand: command not found'result.stderr
''result = run('somebadcommand',combine_stderr=False)
[localhost] run: somebadcommand[localhost] out: /bin/bash: somebadcommand: command not found
[localhost] out:
Warning: run() received nonzero return code 127 while executing
'somebadcommand'!
result.stdout
'/bin/bash: somebadcommand: command not found'result.stderr
''âI expected the second attempt to return stderr to result.stderr instead of
result.stdoutâ
Any help would be greatly appreciated.
Thanks-
Lee