diff options
author | danielsdeleo <dan@getchef.com> | 2014-09-02 15:20:56 -0700 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2014-09-03 12:44:46 -0700 |
commit | ae7d23c48b9d93b0e10789eb3f0e307a18351d99 (patch) | |
tree | c0a9f5208a641069640473e1c9879573ecc56180 /lib/chef/config_fetcher.rb | |
parent | b4145b8ea22c91d22fc66fd585e36e1a415ede38 (diff) | |
download | chef-ae7d23c48b9d93b0e10789eb3f0e307a18351d99.tar.gz |
Remove config file jail, replaced with config skip option
Diffstat (limited to 'lib/chef/config_fetcher.rb')
-rw-r--r-- | lib/chef/config_fetcher.rb | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/chef/config_fetcher.rb b/lib/chef/config_fetcher.rb index 1d0693eaa2..a8aad0740d 100644 --- a/lib/chef/config_fetcher.rb +++ b/lib/chef/config_fetcher.rb @@ -7,11 +7,9 @@ class Chef class ConfigFetcher attr_reader :config_location - attr_reader :config_file_jail - def initialize(config_location, config_file_jail=nil) + def initialize(config_location) @config_location = config_location - @config_file_jail = config_file_jail end def fetch_json @@ -48,24 +46,11 @@ class Chef def config_missing? return false if remote_config? - # Check if the config file exists, and check if it is underneath the config file jail - begin - real_config_file = Pathname.new(config_location).realpath.to_s - rescue Errno::ENOENT - return true - end - - # If realpath succeeded, the file exists - return false if !config_file_jail - - begin - real_jail = Pathname.new(config_file_jail).realpath.to_s - rescue Errno::ENOENT - Chef::Log.warn("Config file jail #{config_file_jail} does not exist: will not load any config file.") - return true - end - - !Chef::ChefFS::PathUtils.descendant_of?(real_config_file, real_jail) + # Check if the config file exists + Pathname.new(config_location).realpath.to_s + false + rescue Errno::ENOENT + return true end def http |