provisioners/chef: disable color if Vagrant has no color [GH-2246]

This commit is contained in:
Mitchell Hashimoto 2013-09-22 14:15:55 -05:00
parent 502c3f6e37
commit 33dd881ad7
2 changed files with 13 additions and 1 deletions

View File

@ -17,6 +17,8 @@ BUG FIXES:
retries. [GH-2234]
- hosts/arch: Vagrant won't crash on Arch anymore. [GH-2233]
- provisioners/ansibe: Extra vars are converted to strings. [GH-2244]
- provisioners/chef: Propagate disabling color if Vagrant has no color
enabled. [GH-2246]
- provisioners/puppet: Work with restrictive umask. [GH-2241]
## 1.3.3 (September 18, 2013)

View File

@ -144,9 +144,19 @@ module VagrantPlugins
@machine.ui.warn(I18n.t("vagrant.chef_run_list_empty"))
end
options = [
"-c #{@config.provisioning_path}/solo.rb",
"-j #{@config.provisioning_path}/dna.json"
]
if !@machine.env.ui.is_a?(Vagrant::UI::Colored)
options << "--no-color"
end
command_env = @config.binary_env ? "#{@config.binary_env} " : ""
command_args = @config.arguments ? " #{@config.arguments}" : ""
command = "#{command_env}#{chef_binary_path("chef-solo")} -c #{@config.provisioning_path}/solo.rb -j #{@config.provisioning_path}/dna.json #{command_args}"
command = "#{command_env}#{chef_binary_path("chef-solo")} " +
"#{options.join(" ")} #{command_args}"
@config.attempts.times do |attempt|
if attempt == 0