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

Comments

Projects
None yet
2 participants
@mattvonrocketstein

mattvonrocketstein commented Aug 23, 2015

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

This comment has been minimized.

Member

bitprophet commented Sep 2, 2015

Gross. Thanks for the catch.

@bitprophet bitprophet added this to the 1.10.3 milestone Sep 2, 2015

@mattvonrocketstein

This comment has been minimized.

mattvonrocketstein commented Sep 2, 2015

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

Edit: PR #1372

@bitprophet

This comment has been minimized.

Member

bitprophet commented Dec 17, 2015

Rolling into PR.

@bitprophet bitprophet closed this Dec 17, 2015

@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