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
hide('running') on the task level is broken #424
Comments
if you look at fabric.main:main, you'll see the 'executing' happens outside the task, which is why it's not hidden, by the hide. As a work around (global!) you can set fabric.state.output['running'] = False, or pass in --hide=running. |
Gregg is right re: executing -- it needs to be a global setting due to when the "Executing" lines are printed -- though I acknowledge that it's not terrifically intuitive and wish there was a better way around it. (I can think of one way to do it for new-style tasks, but not sure it's worth increasing the differences in behavior between the two types, at the moment...) Newlines at the end of The "missing" newlines may be related -- I'd have to double check. May be a situation where it was going to look ugly one way or another and we had to shift the ugliness to the less common case. |
Is there any update on this bug/UI inconsistency? I'm trying to tail a file via fabric, and it'd be great to mask those "[hostname]" output. I tried |
@charlax You can use You should also be able to make that |
Oh right, actually what I'm trying to do is hide the |
Meaning just that part of the line? There is a private config setting for that, but I don't see that changing before fab 2.0 comes out, so I'll let you in on the secret: it's |
Thanks! |
Seems like the @hosts() decorator should make it possible to hide the 'host' part of the running output without forcing disabling of
globally . This would allow overriding the env.hosts for a single method which is what it is meant to do. It seems that it should behave as the env.hosts in that setting it to an empty iterator (or None) should trigger the local_only execution which would not print the host. Currently, an empty iterator in @hosts is ignored and it falls back to using env.hosts. If it will get pulled I will write a patch. |
It would be useful if I could just disable ALL (really literally all) output except what I explicitly print out, except when there's a problem. |
fabfile is:
@task
def show_hostname():
with settings(hide('running')):
run('hostname')
run('date')
% /opt/python-2.7/bin/fab -f output.py -H x1,x2 show_hostname
[x1] Executing task 'show_hostname'
[x1] out: x1mydomain.de
[x1] out: [x1] out: Thu Aug 25 10:34:10 CEST 2011
[x1] out: [x2] Executing task 'show_hostname'
[x2] out: x2.mydomain.de
[x2] out: [x2] out: Thu Aug 25 10:34:11 CEST 2011
[x2] out:
Done.
and while we are at it:
[h1] Executing task 'show_hostname'
[h1] out: h1.mydomain.de
[h1] out:
is 3) by purpose and are 1,2 problems coming from that empty line?
Thanks,
Sven
The text was updated successfully, but these errors were encountered: