Skip to content
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

Lost Puppet colors #685

Closed
jshuping opened this issue Jan 26, 2012 · 9 comments · Fixed by #718
Closed

Lost Puppet colors #685

jshuping opened this issue Jan 26, 2012 · 9 comments · Fixed by #718
Labels

Comments

@jshuping
Copy link

I'm guessing this is related to the recent change around ANSI colors and SSH output. Puppet provides its own coloration of its output to indicate status. In previous Vagrant, it was normal puppet colors. In the newest head, 0.9.3.1, the colors are all green:

[default] Running Puppet with /tmp/vagrant-puppet/manifests/base.pp...
stdin: is not a tty

warning: Could not retrieve fact fqdn
^^^ warnings used to be yellow, are green now

notice: /Stage[init]/Packaging/Exec[apt-configure]/returns: executed successfully
^^^ success used to be light blue, is green now

err: /Stage[services]/Services/Service[supervisor]: Failed to call refresh:
^^^ puppet errors used to be magenta, is green now.

I know this will be low priority, but the puppet colorization is very very handy for knowing if provisioning worked.

Thanks!

@mitchellh
Copy link
Contributor

You're right, marked as a bug.

@mitchellh
Copy link
Contributor

Fixed

@sroegner
Copy link

[vagrant-0.9.4:linux] This still doesn't quite work for me. The puppet provisioner output is apparently filtered by the calls to remove_ansi_escape_codes in lib/vagrant/communication/ssh.rb and thus all puppet info/notice/warning/err output is green. While the escape codes are quite distracting on a non-colorized console they are useful (even needed) otherwise. IMO this should be configurable (there should be a disable_ansi_codes option to control what you are currently mandating).

I tried to work on this in my fork but don't feel to confident where that config attribute should live. Any suggestions?

@mitchellh
Copy link
Contributor

Its not the goal of remove_ansi_escape_codes to remove colors, so I should fix that. The main goal of that method is to remove escape codes that clear the console or otherwise muck with the output in that way.

@jshuping
Copy link
Author

jshuping commented Feb 4, 2012

I'm running 0.9.4 (not from git) now.. should I be seeing the puppet colors fixed? Everything is still "all green".

Thanks!

On Jan 30, 2012, at 10:49 AM, Mitchell Hashimoto wrote:

Its not the goal of remove_ansi_escape_codes to remove colors, so I should fix that. The main goal of that method is to remove escape codes that clear the console or otherwise muck with the output in that way.


Reply to this email directly or view it on GitHub:
#685 (comment)

@mitchellh
Copy link
Contributor

Well, this commit is in 0.9.4 (it appears): 20fa355

However, there may be more issues that have cropped up since then. I may be stripping out colors still accidentally with my remove_ansi_escape_codes method. I have to investigate.

@mitchellh
Copy link
Contributor

@jshuping Removed the color escape filter from the ANSI escape code remover. can you check if it worked? 3eff28a

Git install :)

@jshuping
Copy link
Author

jshuping commented Feb 6, 2012

It works, thank you! Looks dandy! I noticed 2 small things, they don't bother me, but I'll list them for completeness:

  1. One of our puppet output lines is really long. So long that the first part of the line comes out the expected blue, but the latter part of the line seems to get converted into a new line and gets painted the bright green. You can repro this with something like: exec { "foo": command => "/usr/bin/perl -e "print 'A'x20000"", logoutput => true; }
  2. Back in 0.8.10 each line of puppet output was prefixed with your '[default]' tag.

Cheers,
John

On Feb 5, 2012, at 4:31 AM, Mitchell Hashimoto wrote:

@jshuping Removed the color escape filter from the ANSI escape code remover. can you check if it worked? 3eff28a

Git install :)


Reply to this email directly or view it on GitHub:
#685 (comment)

@mitchellh
Copy link
Contributor

@jshuping I'd consider #1 a bug. #2 is as intended, since the [default] would make things look weird if a script you were running outputted things with newlines because some lines had the tag and some didn't. I decided it was easier to just drop it for provisioner output.

Can you open a new bug for #1?

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants