diff --git a/.travis.yml b/.travis.yml index b9ef1ac..700cbc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,3 @@ rvm: - 2.1.1 script: bundle exec rake spec - diff --git a/lib/cheffish.rb b/lib/cheffish.rb index eb9f26e..ae608e6 100644 --- a/lib/cheffish.rb +++ b/lib/cheffish.rb @@ -36,7 +36,11 @@ def self.profiled_config(config = Chef::Config) end def self.load_chef_config(chef_config = Chef::Config) - chef_config.config_file = Chef::Knife.locate_config_file + if ::Gem::Version.new(::Chef::VERSION) >= ::Gem::Version.new('12.0.0') + chef_config.config_file = ::Chef::Knife.chef_config_dir + else + chef_config.config_file = ::Chef::Knife.locate_config_file + end config_fetcher = Chef::ConfigFetcher.new(chef_config.config_file, chef_config.config_file_jail) if chef_config.config_file.nil? Chef::Log.warn("No config file found or specified on command line, using command line options.")