fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] combine_stderr = False has no effect


From: Lee Hughes
Subject: [Fab-user] combine_stderr = False has no effect
Date: Mon, 10 Nov 2014 13:10:15 -0800

Hi I'm new to Fabric and am having trouble separating stderr from stdout. This is with Fabric 1.10.0 on Python 2.7.3:

>>> 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: 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]