fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Question on "roles" and depend vs invoke.


From: Christian Vest Hansen
Subject: Re: [Fab-user] Question on "roles" and depend vs invoke.
Date: Mon, 17 Nov 2008 11:28:05 +0100

On Mon, Nov 17, 2008 at 10:58 AM, Nicolas Steinmetz
<address@hidden> wrote:
> Hello,
>
> I just switched to master version to get roles, depends & last commit from
> Jeff working and I have a question on the sample file :
>
> 1/ Question on roles :
>
> @roles('rdbms')
> def prepare_db():
>     run("echo Preparing database for deployment")
>
> @roles('httpd')
> def prepare_web():
>     run("echo Preparing web servers for deployment")
>
> @depends(prepare_db, prepare_web)
> @roles('httpd')
> def deploy():
>     run("echo Doing final deployment things to $(fab_host)")
>
> What is the use of @roles("httpd") for deploy whereas  roles are already set
> in the prepare_db and prepare_web level ?
>
> Shouldn't it be :
>
> @depends(prepare_db, prepare_web)
> def deploy():
>     run("echo Doing final deployment things to $(fab_host)")

The prepare_db and prepare_web each run with different roles. In this
example you have here, which of these roles do you suppose the `run`
operation should execute with?

Roles apply to the individual command that they are attached to, and
do not linger on or have side-effects on other commands.

>
> 2/ Question on depends vs invoke
>
> Based on same example, should i understand that depends will be run and then
> act as a replacement of invoke ?

Yes.

>
> 3/ Fabric > 0.0.9 is python 2.5+ only as functools is not available in
> python 2.4 (which I have to use... so I'm blocked on 0.0.9 release at
> work... grumbl...)

I cannot speak for the other developers, but I don't test Fabric on
Python 2.4 (and have stated as much on the web site), so currently the
Fabric + Python 2.4 makes for a bumpier ride.

But I will gladly accept patches, if someone were to show Fabric a
little Python 2.4 love. :)

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



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.




reply via email to

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