fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] combine_stderr = False has no effect


From: Jeff Forcier
Subject: Re: [Fab-user] combine_stderr = False has no effect
Date: Mon, 10 Nov 2014 20:46:19 -0800

You probably also need to explicitly say 'pty=False' - see
http://docs.fabfile.org/en/1.10/usage/interactivity.html#combining-the-two

On Mon, Nov 10, 2014 at 1:10 PM, Lee Hughes <address@hidden> wrote:
> 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
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

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