Bug with module tasks throws exception #441

Closed
mitchellh opened this Issue Sep 23, 2011 · 1 comment

Projects

None yet

2 participants

@mitchellh

Hello,

If you import a module and get the nice task of "module.task" format, you can get fabric to explode by calling "fab module"

This is with Fabric 1.2.2

For example, I have a module named "foo.py"

from fabric.api import task

@task
def hello():
    print "HELLO!"

Then the fabfile:

import foo

Then when you do a fab foo (shouldn't be valid):

Traceback (most recent call last):
  File "/etc/virtualenvs/tornado-web/lib/python2.6/site-packages/fabric/main.py", line 778, in main
    _run_task(task, args, kwargs)
  File "/etc/virtualenvs/tornado-web/lib/python2.6/site-packages/fabric/main.py", line 629, in _run_task
    return task(*args, **kwargs)
TypeError: '_Dict' object is not callable

I think it should instead say something like the following:


Fatal error: Command(s) not found:
    foo

Aborting.

Best,
Mitchell

@bitprophet bitprophet was assigned Sep 23, 2011
@bitprophet
Member

Fixed for both 1.1 (no @task(default) available) and 1.2 (@task(default) taken into account).

@bitprophet bitprophet closed this Nov 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment