fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Output of local()


From: Sverre Johansen
Subject: Re: [Fab-user] Output of local()
Date: Tue, 10 Feb 2009 13:38:11 +0530

Hi Christian.

That is absolutely a problem. And another problem is that subprocess seems
to hang if the output is larger than 64k:

    
http://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/

And probably you don't want to capture the output of every command, and rather
make it optional - both for local and run/sudo.

What do you think about adding separate functions for setting variables
from commands, or having an optional argument that enables this?

To reuse the names from subprocess.py:
    output =  run("ls", stdout=PIPE)
    output =   sudo("ls", stdout=PIPE)
    output =   local("ls", stdout=PIPE)

or
    output = set_run("ls")
    output = set_sudo("ls")
    output = set_local("ls")

Maybe the last one is better

---
     Sverre Johansen

On Sun, Feb 1, 2009 at 6:51 PM, Christian Vest Hansen
<address@hidden> wrote:
> Hi Sverre.
>
> With your change, the output of whatever is executed with `local()` is
> no longer printed to stdout like it used to.
>
> A patch needs to keep that working to be accepted. That is, working in
> the same sense of `run` and `sudo` where the output is printed as it
> is produced - merely printing "output" prior to returning it is not
> good enough in my opinion.
>
> On Thu, Jan 29, 2009 at 7:08 PM, Jeff Forcier <address@hidden> wrote:
>> Hi Sverre,
>>
>> No, I believe I just never got around to adding it to local(), as I
>> never personally use local() and the "run()/sudo() return command
>> output" feature was me scratching a specific itch. It's definitely
>> something good to add for consistency's sake.
>>
>> I'll check out your patch, so thanks for that.
>>
>> Best,
>> Jeff
>>
>> On Thu, Jan 29, 2009 at 12:48 PM, Sverre Johansen
>> <address@hidden> wrote:
>>> Hi,
>>>
>>> Is there any reason that local() does not return the output of the
>>> commands, like run() and sudo() does?
>>>
>>> I need this to call `git rev-parse` to use the revision number as part
>>> of the deploy directory on the server. I also think it makes sense for
>>> keeping consistency between the functions.
>>>
>>> Attached is a patch that implements this.
>>>
>>> --
>>>           Sverre Johansen
>>>
>>> _______________________________________________
>>> Fab-user mailing list
>>> address@hidden
>>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>>
>>>
>>
>>
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>
>
>
> --
> Venlig hilsen / Kind regards,
> Christian Vest Hansen.
>



-- 
           Sverre Johansen




reply via email to

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