summaryrefslogtreecommitdiff
path: root/lib/chef/application
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-20 10:17:50 +0000
committerThom May <thom@chef.io>2018-02-20 10:17:50 +0000
commit55cdc47879b6357b8da1b5c6349f0c23ddb83ba9 (patch)
tree5f006652ebfefcbe765a5cfbaec84a8b455be091 /lib/chef/application
parent13ea697152ec89704b4a725565a684e1c8f32203 (diff)
downloadchef-55cdc47879b6357b8da1b5c6349f0c23ddb83ba9.tar.gz
Allow tarballs generated by chef export to be usedtm/policyful_tarballs
If we find a config file in the exported tarball, load it up. This way we can use --recipe-url with the direct results of `chef export -a` Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/application')
-rw-r--r--lib/chef/application/client.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index 32530925d5..0834e5f037 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -345,6 +345,8 @@ class Chef::Application::Client < Chef::Application
tarball_path = File.join(Chef::Config.chef_repo_path, "recipes.tgz")
fetch_recipe_tarball(Chef::Config[:recipe_url], tarball_path)
Mixlib::Archive.new(tarball_path).extract(Chef::Config.chef_repo_path, perms: false, ignore: /^\.$/)
+ config_path = File.join(Chef::Config.chef_repo_path, ".chef/config.rb")
+ Chef::Config.from_string(IO.read(config_path), config_path) if File.file?(config_path)
end
end