summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Albertson <lance@osuosl.org>2020-09-14 13:16:31 -0700
committerLance Albertson <lance@osuosl.org>2020-09-15 14:04:36 -0700
commitabbaf5a19db7c58b8d0fcabbb285fe390ec4be3d (patch)
treeb095b1b8731fc9a8a3e9aef5582331f242039ee2
parent993160c680fc99e6379d1486167653681e0ee247 (diff)
downloadchef-abbaf5a19db7c58b8d0fcabbb285fe390ec4be3d.tar.gz
Revert change that removed use of Chef::Config.platform_specific_path
Signed-off-by: Lance Albertson <lance@osuosl.org>
-rw-r--r--lib/chef/application/solo.rb2
-rw-r--r--lib/chef/encrypted_data_bag_item.rb2
-rw-r--r--lib/chef/shell.rb4
-rw-r--r--lib/chef/train_transport.rb4
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb
index 5831a07349..cda0852e13 100644
--- a/lib/chef/application/solo.rb
+++ b/lib/chef/application/solo.rb
@@ -34,7 +34,7 @@ class Chef::Application::Solo < Chef::Application::Base
option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",
- default: "#{ChefConfig::Config.etc_chef_dir}/solo.rb",
+ default: Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/solo.rb"),
description: "The configuration file to use."
unless ChefUtils.windows?
diff --git a/lib/chef/encrypted_data_bag_item.rb b/lib/chef/encrypted_data_bag_item.rb
index f267b1c537..9cf1a71db2 100644
--- a/lib/chef/encrypted_data_bag_item.rb
+++ b/lib/chef/encrypted_data_bag_item.rb
@@ -130,7 +130,7 @@ class Chef::EncryptedDataBagItem
require "open-uri" unless defined?(OpenURI)
path ||= Chef::Config[:encrypted_data_bag_secret]
unless path
- raise ArgumentError, "No secret specified and no secret found at #{ChefConfig::Config.etc_chef_dir + "/encrypted_data_bag_secret"}"
+ raise ArgumentError, "No secret specified and no secret found at #{Chef::Config.platform_specific_path(ChefConfig::Config.etc_chef_dir) + "/encrypted_data_bag_secret"}"
end
secret = case path
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 08016e97d5..a425129fa8 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -365,9 +365,9 @@ module Shell
elsif dot_chef_dir && ::File.exist?(File.join(dot_chef_dir, ChefUtils::Dist::Infra::SHELL_CONF))
File.join(dot_chef_dir, ChefUtils::Dist::Infra::SHELL_CONF)
elsif config[:solo_legacy_shell]
- "#{ChefConfig::Config.etc_chef_dir}/solo.rb"
+ Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/solo.rb")
elsif config[:client]
- "#{ChefConfig::Config.etc_chef_dir}/client.rb"
+ Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/client.rb")
elsif config[:solo_shell]
Chef::WorkstationConfigLoader.new(nil, Chef::Log).config_location
else
diff --git a/lib/chef/train_transport.rb b/lib/chef/train_transport.rb
index f2ab69921c..7d6539b416 100644
--- a/lib/chef/train_transport.rb
+++ b/lib/chef/train_transport.rb
@@ -77,8 +77,8 @@ class Chef
credentials_file =
if tm_config.credentials_file && File.exist?(tm_config.credentials_file)
tm_config.credentials_file
- elsif File.exist?("#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials")
- "#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials"
+ elsif File.exist?(Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials"))
+ Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/#{profile}/credentials")
else
super
end