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.
This commit is contained in:
Dan Carley 2012-10-30 11:10:26 +00:00
parent 44804ce94b
commit fec9410814
2 changed files with 4 additions and 2 deletions

View File

@ -159,7 +159,8 @@ module VagrantPlugins
:manifest => @manifest_file)
env[:machine].communicate.sudo(command) do |type, data|
env[:ui].info(data.chomp, :prefix => false)
data.chomp!
env[:ui].info(data, :prefix => false) if !data.empty?
end
end

View File

@ -71,7 +71,8 @@ module VagrantPlugins
env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
env[:vm].channel.sudo(command) do |type, data|
env[:ui].info(data.chomp, :prefix => false)
data.chomp!
env[:ui].info(data, :prefix => false) if !data.empty?
end
end
end