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

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

Projects

None yet

2 participants

@mattvonrocketstein

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
Member

Gross. Thanks for the catch.

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

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

Edit: PR #1372

@bitprophet
Member

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