From 8abada25b9fba743fb20e7388a1c09206ee0cfd8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 17 Jan 2012 21:16:24 -0800 Subject: [PATCH] Fix poor variable reference in puppet server. Also colorize output --- lib/vagrant/provisioners/puppet_server.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/provisioners/puppet_server.rb b/lib/vagrant/provisioners/puppet_server.rb index 93c2f193e..40d16963d 100644 --- a/lib/vagrant/provisioners/puppet_server.rb +++ b/lib/vagrant/provisioners/puppet_server.rb @@ -44,9 +44,14 @@ module Vagrant command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" - env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") + env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") env[:vm].channel.sudo(command) do |type, data| - env.ui.info(data) + # Output the data with the proper color based on the stream. + color = type == :stdout ? :green : :red + + # Note: Be sure to chomp the data to avoid the newlines that the + # Chef outputs. + env[:ui].info(data.chomp, :color => color, :prefix => false) end end end