On Wed, Sep 15, 2010 at 10:28 AM, Eric Buckley <eric.buck...@gmail.com> wrote:
> Thanks for getting back to me, to be more specific I'd like to create a task
> called 'deploy' which is responsible for invoking a series of other methods
> (e.g. pull(), checkout(), requirements(), restart(), etc.).

You should check out the use docs on the execution model:

    http://docs.fabfile.org/0.9.2/usage/execution.html

Specifically the bit on how connections are set up:

    http://docs.fabfile.org/0.9.2/usage/execution.html#connections

The gist is that right now, the decorators only apply to "top level"
tasks as invoked via the command line -- subroutines are 100% literal
Python function calls and can't be detected or otherwise modified by
the main execution loop.

You can get the desired behavior by ensuring that env.host_string is
updated for your subroutines as desired, something along the lines of
"for host in [list, of, host, strings]: with
settings(host_string=host): subroutine()". (You can of course also do
something like "for host in env.roledefs['rolename']:".)

In future versions we'll have a helper for this, and eventually the
exec model will get more fleshed out in general.

Hope that helps,
Jeff


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

_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to