fab-user
[Top][All Lists]
Advanced

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

Fwd: [Fab-user] Collecting output when using Fabric directly in python


From: Yann Malet
Subject: Fwd: [Fab-user] Collecting output when using Fabric directly in python
Date: Sun, 16 Aug 2009 18:33:29 -0400



Hello,

Oups I thought that I had already push the code out of the door.  :-)  Here it is the link to the repository : http://bitbucket.org/yml/fabric_factory/

Also the first intention was not to do some shameless promotion of this project of mine that is still both immature not fully working. This being said the intention is to built a continuous intergration server and client based on django and fabric. So far I have been pleased by the way things stick together.

The proof of concept enable me to store a Recipe (mainly a fabric file) to create a Build which is defined by a link to the Recipe and  a task. The client can request Build from the server execute it and return the results to the server. This is where I need your help   :-)

The exact place in the code is there : http://bitbucket.org/yml/fabric_factory/src/tip/src/worker/__init__.py#cl-38

what I would like to do is to collect the output and the error eventualy doing something like this :
self.output, self.error = fabfile.task()  

where in fact, if I am understanding it correctly, they are directed to stdout and stderr.
I would like to be able to capture them in my Worker and send them to my Factory (django server) in most cases the worker will
run in a daemonized mode.

I hope that this help you to get a better understanding about my request.
Regards,
Yann




On Sun, Aug 16, 2009 at 1:57 PM, Steve Steiner <address@hidden> wrote:

On Aug 15, 2009, at 11:03 PM, Jeff Forcier wrote:

Stderr is not currently captured in this manner, though I might be
amenable to adding this functionality in the future (e.g. a
"capture_stderr" boolean keyword argument that switches the behavior
from capturing stdout to capturing stderr.)

I would like this too.

I've mostly been using Fabric from the command line, with a local fabfile.py.

Now, I'm just starting to call into Fabric code from regular Python scripts and can see that I'm going to need this functionality, too.

Can this be done more nicely as a decorator since we've already got a Python 2.5+ requirement anyway?

@capture_stderr
def func_that_wants_stderr(...)
       pass

Thanks,

S




reply via email to

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