From a06742b8ef40b983d949bc9492a5a2a432530323 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 5 Sep 2013 16:34:21 -0700 Subject: [PATCH] provisioners/chef: env config less restrictive --- CHANGELOG.md | 1 + plugins/provisioners/chef/config/chef_solo.rb | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9642bdcc..e7058e74c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ BUG FIXES: - core: `VAGRANT_VAGRANTFILE` env var only applies to the project Vagrantfile name. [GH-2130] - provisioners/chef: Work even with restrictive umask on user. [GH-2121] + - provisioners/chef: Fix environment validation to be less restrictive. - provisioners/puppet: No more "shared folders cannot be found" error. [GH-2134] - provisioners/puppet: Work with restrictive umask on user by testing diff --git a/plugins/provisioners/chef/config/chef_solo.rb b/plugins/provisioners/chef/config/chef_solo.rb index d3cd2fc30..feeb3b57d 100644 --- a/plugins/provisioners/chef/config/chef_solo.rb +++ b/plugins/provisioners/chef/config/chef_solo.rb @@ -46,7 +46,8 @@ module VagrantPlugins @data_bags_path = [] if @data_bags_path == UNSET_VALUE @roles_path = [] if @roles_path == UNSET_VALUE - @environments_path = [] if @environments_path == UNSET_VALUE or @recipe_url == nil + @environments_path = [] if @environments_path == UNSET_VALUE + @environments_path = [@environments_path].flatten # Make sure the path is an array. @cookbooks_path = prepare_folders_config(@cookbooks_path) @@ -67,7 +68,7 @@ module VagrantPlugins errors << I18n.t("vagrant.config.chef.cookbooks_path_empty") if \ !cookbooks_path || [cookbooks_path].flatten.empty? errors << I18n.t("vagrant.config.chef.environment_path_required") if \ - environment and (!environments_path || [environments_path].flatten.empty?) + environment && environments_path.empty?) { "chef solo provisioner" => errors } end