summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hain <shain@chef.io>2015-05-22 14:52:49 -0700
committerScott Hain <shain@chef.io>2015-05-22 14:52:49 -0700
commitd61df201256aa03d7c19944ebef020d40ee1fa29 (patch)
tree54d4fe1b3ecd72d536507a94658ce629b9b1a224
parent92cb65508c198d04fb12e1e99475c80bd8a16c4a (diff)
downloadchef-shain/fix_cli.tar.gz
Fix cli issue with unset chef_repo_pathshain/fix_cli
-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