summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hain <shain@chef.io>2015-05-26 10:06:04 -0700
committerScott Hain <shain@chef.io>2015-05-26 10:06:04 -0700
commitef28eff998eba6433d00c81376a38e6180985c10 (patch)
tree5814076e086cf7c05e76f4da1eb563d5f126987f
parent4a70082d4651ecae058f7ed00b2c918e9155a2d8 (diff)
parentd61df201256aa03d7c19944ebef020d40ee1fa29 (diff)
downloadchef-ef28eff998eba6433d00c81376a38e6180985c10.tar.gz
Merge pull request #3419 from chef/shain/fix_cli
Fix cli issue with unset chef_repo_path
-rw-r--r--lib/chef/application/client.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index a5faee9d35..551e26e303 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -279,6 +279,12 @@ class Chef::Application::Client < Chef::Application
Chef::Config[:chef_server_url] = config[:chef_server_url] if config.has_key? :chef_server_url
Chef::Config.local_mode = config[:local_mode] if config.has_key?(:local_mode)
+
+ if Chef::Config.has_key?(:chef_repo_path) && Chef::Config.chef_repo_path.nil?
+ Chef::Config.delete(:chef_repo_path)
+ Chef::Log.warn "chef_repo_path was set in a config file but was empty. Assuming #{Chef::Config.chef_repo_path}"
+ end
+
if Chef::Config.local_mode && !Chef::Config.has_key?(:cookbook_path) && !Chef::Config.has_key?(:chef_repo_path)
Chef::Config.chef_repo_path = Chef::Config.find_chef_repo_path(Dir.pwd)
end