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

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

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

Comments

Projects
None yet
3 participants
@bitprophet
Member

bitprophet commented Aug 19, 2011

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

@ghost ghost assigned bitprophet Aug 19, 2011

@bitprophet

This comment has been minimized.

Member

bitprophet commented Aug 19, 2011

Jeff Forcier (bitprophet) posted:


Sounds like a bug. What version are you using?


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

@bitprophet

This comment has been minimized.

Member

bitprophet commented Aug 19, 2011

Nick Trew (vxnick) posted:


I'm using master 1.0.1


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

@dholt

This comment has been minimized.

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

This comment has been minimized.

Member

bitprophet commented Jan 6, 2012

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

This comment has been minimized.

Member

bitprophet commented Jan 6, 2012

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

This comment has been minimized.

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

This comment has been minimized.

vxnick commented Jan 6, 2012

Likewise, this was before I was using @task.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Jan 6, 2012

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

This comment has been minimized.

Member

bitprophet commented Jan 11, 2012

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 added a commit that referenced this issue Jan 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment