From c6cce57ff46fdb5145124c260894c3517c5eb0f0 Mon Sep 17 00:00:00 2001 From: Jeff Quast Date: Wed, 3 Dec 2014 21:48:30 -0800 Subject: [PATCH] Avoid double-newlines in salt-call output When using the salt provisioner with verbose=true, most lines read with an extra newline: ``` [INFO ] Syncing modules for environment 'base' [INFO ] Loading cache from salt://_modules, for base) ``` because the line read has a newline, and emitting the log entry again includes an additional newline. --- plugins/provisioners/salt/provisioner.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index c5db597a0..a47bce2a6 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -306,7 +306,7 @@ module VagrantPlugins @machine.communicate.sudo("salt '*' saltutil.sync_all") @machine.communicate.sudo("salt '*' state.highstate --verbose#{get_loglevel}#{get_colorize}#{get_pillar}") do |type, data| if @config.verbose - @machine.env.ui.info(data) + @machine.env.ui.info(data.rstrip) end end else @@ -315,14 +315,14 @@ module VagrantPlugins @machine.communicate.execute("C:\\salt\\salt-call.exe saltutil.sync_all", opts) @machine.communicate.execute("C:\\salt\\salt-call.exe state.highstate --retcode-passthrough #{get_loglevel}#{get_colorize}#{get_pillar}", opts) do |type, data| if @config.verbose - @machine.env.ui.info(data) + @machine.env.ui.info(data.rstrip) end end else @machine.communicate.sudo("salt-call saltutil.sync_all") @machine.communicate.sudo("salt-call state.highstate --retcode-passthrough #{get_loglevel}#{get_colorize}#{get_pillar}") do |type, data| if @config.verbose - @machine.env.ui.info(data) + @machine.env.ui.info(data.rstrip) end end end