I have a number of tasks defined as Task subclasses and I have roledefs set similar to the following:
env.roledefs = { "web": ["1.2.3.4"], "db": ["5.6.7.8"] }
class Foo(Task):
name = "foo"
def run(self):
pass
foo = Foo()
With the @roles decorator I can decorate tasks if they are functions in a module but I’m not sure how to apply this to Task classes. Decorating the class or its run function doesn’t seem to work.
I’m using Fabric 1.4.0
Think you should be able to use the init it like:
or use execute: