fabric.utils.indent (and fabric.colors.*) listed in --list #339

Closed
bitprophet opened this Issue Aug 19, 2011 · 9 comments

Projects

None yet

3 participants

@bitprophet
Member

Description

Not 100% sure if this is a bug, but it would appear to me that this isn't set as _internal and is therefore showing up in fab --list.

Wouldn't normally be an issue, but I'm trying to make --list tidy enough for some completely non-tech staff to be able to look at it and use defined tasks.

FYI, the same happens with fabric.colors. Again, not sure if this is actually a bug.


Originally submitted by Nick Trew (vxnick) on 2011-04-20 at 08:42am EDT

@bitprophet bitprophet was assigned Aug 19, 2011
@bitprophet
Member

Jeff Forcier (bitprophet) posted:


Sounds like a bug. What version are you using?


on 2011-04-20 at 10:23am EDT

@bitprophet
Member

Nick Trew (vxnick) posted:


I'm using master 1.0.1


on 2011-04-20 at 10:25am EDT

@dholt
dholt commented Nov 3, 2011

I'm having the same issue with colors showing up when using fab -l; I'm using 1.3.1 from PyPI.

@bitprophet
Member

epicserve on IRC is having this too, with colors.green (imported as: from fabric.colors import green), and he is using fab 1.3.3 and using @task on his tasks in the fabfile.

I can't reproduce the problem with a barebones fabfile that just imports green and task and defines a single task.

However, I can reproduce it with epicserve's fabfile. Trimming down it looks like @roles is the key. Need to figure out why.

@bitprophet
Member

Turns out he had @roles above @task, which normally would hide the task entirely (@task has to come on top to work correctly, as per #410) but since he is decorating all tasks with @roles (above @task), the Fab import mechanisms don't actually see any new-style tasks, which falls back to classic-style task searching, and that's why green is being picked up.

To @dholt and @vxnick could you check to see if this was the problem for you as well? (I.e. not having @task before other decorators, and that probably on all tasks in the file.) If so, I'll close this as a dupe of #410, which will then get a higher priority since it's causing these problems too.

Edit: to be clear, the problem is doing this:

@roles('foo')
@task
def blah():
    # ...

Which should be this instead:

@task
@roles('foo')
def blah():
    # ...
@dholt
dholt commented Jan 6, 2012

I believe I wasn't using @task at all when I posted that comment; I added @task shortly after and it did seem to fix the problem.

@vxnick
vxnick commented Jan 6, 2012

Likewise, this was before I was using @task.

@bitprophet
Member

OK, thanks guys -- good to know.

I'll try and remember to ensure fabric.colors is marked as internal so that it doesn't bite anybody still using old-style tasks. Was probably holding off on that because it wasn't super public pending #101, but at this point it's been around long enough to require full treatment.

Leaving this open until I handle that.

@bitprophet
Member

Fixed in 56ceefb (missed the # in the commit, sigh).

The next release for 1.1.x, 1.2.x and 1.3.x will mask out fabric.colors.* from fab -l.

@bitprophet bitprophet closed this Jan 11, 2012
@bitprophet bitprophet added a commit that referenced this issue Jan 13, 2012
@bitprophet bitprophet Changelog entry re #339 3edb315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment