fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] @roles failing


From: Jeff Forcier
Subject: Re: [Fab-user] @roles failing
Date: Fri, 4 Sep 2009 10:00:01 -0400

Hi Thomas,

On Fri, Sep 4, 2009 at 9:49 AM, Thomas Bikeev<address@hidden> wrote:
> Hi list,
>
> I am trying to repeat documentation example on @roles decorator but seem to 
> fail ...
>
> Any clues? Cheers, Thomas
>
>
>   1 from fabric.state import env
>   2 from fabric.decorators import roles
>   3
>   4 env.webserver = ['www1', 'www2']
>   5 env.dbserver = ['db1']

Check out the docs:

    http://docs.fabfile.org/0.9/usage.html#defining-roles

You need to define the roles in env.roledefs (a dict), not as
top-level env variables :) So you could replace lines 4 and 5 with the
below::

    env.roledefs = {
        'webserver': ['www1', 'www2'],
        'dbserver': ['db1']
    }

That should work correctly.

The docs are pretty sparse right now; they'll be updated soon to be more
tutorial-esque in spots, so stuff like this should become more visible.

Best,
Jeff




reply via email to

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