[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] Jumping between roles
From: |
Corry Haines |
Subject: |
[Fab-user] Jumping between roles |
Date: |
Thu, 5 May 2011 09:30:04 -0700 |
After trying out a few (failed) iterations, it seems that I should ask the mailing list if this is even possible.
In short, I would like to have functions call other functions, and when the new function starts, it is applied to distinct roles. An example follows:
@roles("a")
def entry_function():
# Run some code specific to role a
second_function()
# More role a specific code
@roles("b")
def second_function():
# Run some code specific to role b
When I try this, it seems that there is a "First Wins" behavior, and role "a" is used for second_function. This happens regardless of the roles specified on the command line.
Is it possible for the command line to specify a list of roles, and have some of the internal functions operate on a distinct set of roles? A use case is a deployment function (the entry function) that needs to update the RPM repo before running anything else.
Thanks,
Corry
- [Fab-user] Jumping between roles,
Corry Haines <=