diff options
author | Lance Albertson <lance@osuosl.org> | 2020-08-18 09:51:08 -0700 |
---|---|---|
committer | Lance Albertson <lance@osuosl.org> | 2020-09-15 14:04:36 -0700 |
commit | b1d85847cfa1c15840c9768bdbb36a77d3d5abbf (patch) | |
tree | b8f08583fed777a8479450f982025a88be668007 /lib/chef | |
parent | 7dabc07d5ee1970f22fb9e6366eb7139386d30da (diff) | |
download | chef-b1d85847cfa1c15840c9768bdbb36a77d3d5abbf.tar.gz |
Move chef-config/dist to chef-utils/dist
This migrates constants used in chef-config/dist to chef-utils/dist so that they
all reside in one place. Other changes include:
- Remove Compliance, Inspec, Run, Inspec, Workstation class constants as they
are new and not being used yet. Leave this to be added in a later PR.
Signed-off-by: Lance Albertson <lance@osuosl.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/application/client.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 2 | ||||
-rw-r--r-- | lib/chef/node_map.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/chef_gem.rb | 12 | ||||
-rw-r--r-- | lib/chef/resource/gem_package.rb | 6 | ||||
-rw-r--r-- | lib/chef/resource/homebrew_update.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/macos_userdefaults.rb | 4 |
7 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 77b8de3d0d..d9ab58eced 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -153,7 +153,7 @@ class Chef::Application::Client < Chef::Application::Base if config[:local_mode] config[:config_file] = Chef::WorkstationConfigLoader.new(nil, Chef::Log).config_location else - config[:config_file] = "#{ChefConfig::Config.etc_chef_dir}/client.rb" + config[:config_file] = Chef::Config.platform_specific_path("#{ChefConfig::Config.etc_chef_dir}/client.rb") end end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 64943b5a23..e8d1636223 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -540,7 +540,7 @@ class Chef end def run - check_license if ChefConfig::Dist::ENFORCE_LICENSE + check_license if ChefUtils::Dist::Org::ENFORCE_LICENSE plugin_setup! validate_name_args! diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb index 30a0ed6c4e..ae65d2fc66 100644 --- a/lib/chef/node_map.rb +++ b/lib/chef/node_map.rb @@ -36,7 +36,7 @@ # XXX: confusingly, in the *_priority_map the :klass may be an array of Strings of class names # -require_relative "dist" +require "chef-utils/dist" class Chef class NodeMap @@ -86,7 +86,7 @@ class Chef else klass.superclass.to_s end - Chef::Log.warn( COLLISION_WARNING % { type: type_of_thing, key: key, type_caps: type_of_thing.capitalize, client_name: Chef::Dist::PRODUCT } ) + Chef::Log.warn( COLLISION_WARNING % { type: type_of_thing, key: key, type_caps: type_of_thing.capitalize, client_name: ChefUtils::Dist::Infra::PRODUCT } ) end # The map is sorted in order of preference already; we just need to find diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb index ba2dae96b9..80aa2e1859 100644 --- a/lib/chef/resource/chef_gem.rb +++ b/lib/chef/resource/chef_gem.rb @@ -27,27 +27,27 @@ class Chef provides :chef_gem description <<~DESC - Use the **chef_gem** resource to install a gem only for the instance of Ruby that is dedicated to the #{Chef::Dist::CLIENT}. + Use the **chef_gem** resource to install a gem only for the instance of Ruby that is dedicated to the #{ChefUtils::Dist::Infra::CLIENT}. When a gem is installed from a local file, it must be added to the node using the **remote_file** or **cookbook_file** resources. The **chef_gem** resource works with all of the same properties and options as the **gem_package** resource, but does not - accept the `gem_binary` property because it always uses the `CurrentGemEnvironment` under which the `#{Chef::Dist::CLIENT}` is + accept the `gem_binary` property because it always uses the `CurrentGemEnvironment` under which the `#{ChefUtils::Dist::Infra::CLIENT}` is running. In addition to performing actions similar to the **gem_package** resource, the **chef_gem** resource does the following: - Runs its actions immediately, before convergence, allowing a gem to be used in a recipe immediately after it is installed. - Runs `Gem.clear_paths` after the action, ensuring that gem is aware of changes so that it can be required immediately after it is installed. - Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{Chef::Dist::PRODUCT} is + Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{ChefUtils::Dist::Infra::PRODUCT} is installed, there are two instances of Ruby. One is the standard, system-wide instance of Ruby and the other is a dedicated instance that is - available only to #{Chef::Dist::PRODUCT}. - Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{Chef::Dist::PRODUCT}. + available only to #{ChefUtils::Dist::Infra::PRODUCT}. + Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{ChefUtils::Dist::Infra::PRODUCT}. Use the **gem_package** resource to install all other gems (i.e. install gems system-wide). DESC examples <<~EXAMPLES **Compile time vs. converge time installation of gems** - To install a gem while #{Chef::Dist::PRODUCT} is configuring the node (the converge phase), set the `compile_time` property to `false`: + To install a gem while #{ChefUtils::Dist::Infra::PRODUCT} is configuring the node (the converge phase), set the `compile_time` property to `false`: ```ruby chef_gem 'right_aws' do compile_time false diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb index 63233d5cb6..0fc469b5c9 100644 --- a/lib/chef/resource/gem_package.rb +++ b/lib/chef/resource/gem_package.rb @@ -31,10 +31,10 @@ class Chef Note: The **gem_package** resource must be specified as `gem_package` and cannot be shortened to `package` in a recipe. - Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{Chef::Dist::PRODUCT} is + Warning: The **chef_gem** and **gem_package** resources are both used to install Ruby gems. For any machine on which #{ChefUtils::Dist::Infra::PRODUCT} is installed, there are two instances of Ruby. One is the standard, system-wide instance of Ruby and the other is a dedicated instance that is - available only to #{Chef::Dist::PRODUCT}. - Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{Chef::Dist::PRODUCT}. + available only to #{ChefUtils::Dist::Infra::PRODUCT}. + Use the **chef_gem** resource to install gems into the instance of Ruby that is dedicated to #{ChefUtils::Dist::Infra::PRODUCT}. Use the **gem_package** resource to install all other gems (i.e. install gems system-wide). DESC diff --git a/lib/chef/resource/homebrew_update.rb b/lib/chef/resource/homebrew_update.rb index 17d756b039..5298104636 100644 --- a/lib/chef/resource/homebrew_update.rb +++ b/lib/chef/resource/homebrew_update.rb @@ -19,7 +19,7 @@ # require_relative "../resource" -require_relative "../dist" +require "chef-utils/dist" class Chef class Resource @@ -38,7 +38,7 @@ class Chef action :periodic end ``` - **Update the Homebrew repository at the start of a #{Chef::Dist::PRODUCT} run**: + **Update the Homebrew repository at the start of a #{ChefUtils::Dist::Infra::PRODUCT} run**: ```ruby homebrew_update 'update' ``` diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index ab789635e7..7ac4b20a6d 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -16,7 +16,7 @@ # require_relative "../resource" -require_relative "../dist" +require "chef-utils/dist" autoload :Plist, "plist" class Chef @@ -97,7 +97,7 @@ class Chef desired_state: false property :sudo, [TrueClass, FalseClass], - description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the '/usr/bin/defaults' command to be setup for the user running #{Chef::Dist::PRODUCT}.", + description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the '/usr/bin/defaults' command to be setup for the user running #{ChefUtils::Dist::Infra::PRODUCT}.", default: false, desired_state: false |