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:
parent
44804ce94b
commit
fec9410814
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue