fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Fabric execution with Python calls instead of command-line


From: Carles Barrobés i Meix
Subject: [Fab-user] Fabric execution with Python calls instead of command-line
Date: Tue, 23 Nov 2010 22:23:23 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ca; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

Hi all,

I'm writing a Django site to allow me remotely manage a series of customer installs of a web application using fabric.

My goal is to call fabric from within some of my Django views (i.e. run some task in a fabfile on some remote servers, all from within the webapp), but I wouldn't like to run "fab" necessarily as a subprocess. I'd like to call the equivalent python methods of fabric instead of a command line.

I was taking a look at the sources of the fabric.main module but it seems to rely very much on command line argument parsing but it doesn't seem to provide the necessary high-level functions to separate parsing and execution (main() is 150 lines and does a lot of stuff).

So far I started using load_fabfile to load a fabfile and get a list of tasks, so that I can present them in my view for selection. But since the fabric.main module is an undocumented part of fabric, I'm not sure I can rely on it staying stable across releases.

My questions, mainly to the developers:
- Can I rely on using functions in fabric.main?
- Are there plans to refactor fabric.main so that it is more usable in the way I suggest, and eventually become a published API?
- Would you be open to contributions in that direction?

Thanks in advance.
C.




reply via email to

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