Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception subclasses should not be shown in "fab -l" #1365

Closed
mattvonrocketstein opened this issue Aug 23, 2015 · 3 comments
Closed

Exception subclasses should not be shown in "fab -l" #1365

mattvonrocketstein opened this issue Aug 23, 2015 · 3 comments

Comments

@mattvonrocketstein
Copy link

To reproduce, create a fabfile.py with contents "class Foo(Exception): pass", then "fab -l" will list it as an available command.

I suppose this happens because callable(Foo) is True, but since using an Exception as a fabric command is nonsense, I would expect this to generate an error like "Fatal error: Fabfile didn't contain any commands!" just like if I had a fabfile consisting only of contents "Foo=[]",

For real fabfiles, this clutters up the namespace and it's annoying to have to do the "from module import SomeException as _SomeException" workaround.

@bitprophet
Copy link
Member

Gross. Thanks for the catch.

@mattvonrocketstein
Copy link
Author

No problem. Since we agree it's a bug now, I'll volunteer to create a patch.

Edit: PR #1372

@bitprophet
Copy link
Member

Rolling into PR.

@bitprophet bitprophet removed this from the 1.10.3 milestone Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants