Skip to content

Bug with module tasks throws exception #441

@mitchellh

Description

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions