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 mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to