mitchellh/vagrant — pull request #1213 by dcarley (2012-10-30 11:28:51+00:00)
Title: Omit empty lines in Puppet provisioner output

The sudo() block and/or the Puppet provisioner often returns newline
characters as separate strings. This makes the chomp() ineffective and
results in extraneous spacing between the output lines.

Separate out the call to chomp() so that we only do it once. Then only
output info if that line is not an empty string.

--

Here's an example of the previous behaviour using `pp` instead of `env[:ui].info`:
``` sh
$ vagrant provision ja01
[ja01] Running provisioner: Vagrant::Provisioners::Puppet...
[ja01] Running Puppet with /tmp/vagrant-puppet/manifests/site.pp...
"\e[0;36mnotice: /Firewall[100 ssh]/ensure: created\e[0m"
"\n"
"\e[0;36mnotice: /Firewall[999 default_policy]/ensure: created\e[0m"
"\n"
"\e[0;36mnotice: /Firewall[002 allow_icmp]/ensure: created\e[0m"
"\n"
"\e[0;36mnotice: /Firewall[500 tomcat]/ensure: created\e[0m"
"\n"
"\e[0;36mnotice: /Firewall[001 allow_loopback]/ensure: created\e[0m"
"\n"
"\e[0;36mnotice: Finished catalog run in 5.01 seconds\e[0m"
"\n"
""
```