sebastien / cuisine

Chef-like functionality for Fabric

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cuisine seems not to support Fabric decorators

alb-i986 opened this issue · comments

http://docs.fabfile.org/en/latest/api/core/decorators.html

I have @host and @task in my fabfile and cuisine complains about it.
I suppose it doesn't support decorators at all (?).
It would be great if it did.

Below the output of 'fab -l':

  • the former happened before any edit of fabfile
  • the latter happened after removing all the '@task' decorators
  • once removed the @host decorator, it worked

Thank you

Best

Alberto


(pluto4)alb@alb-desktop:/tmp/djdepl/pluto4/src$ fab -l
Traceback (most recent call last):
File "/tmp/djdepl/pluto4/lib/python2.6/site-packages/fabric/main.py", line 654, in main
docstring, callables, default = load_fabfile(fabfile)
File "/tmp/djdepl/pluto4/lib/python2.6/site-packages/fabric/main.py", line 165, in load_fabfile
imported = importer(os.path.splitext(fabfile)[0])
File "/tmp/djdepl/pluto4/src/fabfile.py", line 22, in
@hosts('django@192.168.8.10')
NameError: name 'hosts' is not defined

(pluto4)alb@alb-desktop:/tmp/djdepl/pluto4/src$ vim fabfile.py (pluto4)alb@alb-desktop:/tmp/djdepl/pluto4/src$ fab -lTraceback (most recent call last):
File "/tmp/djdepl/pluto4/lib/python2.6/site-packages/fabric/main.py", line 654, in main
docstring, callables, default = load_fabfile(fabfile)
File "/tmp/djdepl/pluto4/lib/python2.6/site-packages/fabric/main.py", line 165, in load_fabfile
imported = importer(os.path.splitext(fabfile)[0])
File "/tmp/djdepl/pluto4/src/fabfile.py", line 17, in
@task
NameError: name 'task' is not defined

You probably have to import task and hosts from Fabric.

that's right, thanks

I was mislead by the slide#55 [1] when it states that, by importing cuisine, "Fabric's core functionalities are already imported".

[1] http://www.slideshare.net/ffunction/fabric-cuisine-and-watchdog-for-server-administration-in-python