summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Chamberland <mchamberland@pbsc.com>2019-05-05 20:08:36 -0400
committerMarc Chamberland <mchamberland@pbsc.com>2019-05-23 12:30:56 -0400
commitc08d0b8789b9ad5ac8082bef370d5cc6ae5b610f (patch)
tree0f7ad457fac7e52f87e34e29ef865e5a979580e8
parent44aae2c29d0c4ba28b4dbfc8c638036d8a2663ec (diff)
downloadchef-c08d0b8789b9ad5ac8082bef370d5cc6ae5b610f.tar.gz
More distro constant applications
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
-rw-r--r--lib/chef/application/exit_code.rb4
-rw-r--r--lib/chef/event_loggers/windows_eventlog.rb3
-rw-r--r--lib/chef/knife/bootstrap.rb2
-rw-r--r--lib/chef/knife/cookbook_site_download.rb3
-rw-r--r--lib/chef/knife/cookbook_site_install.rb3
-rw-r--r--lib/chef/knife/cookbook_site_list.rb3
-rw-r--r--lib/chef/knife/cookbook_site_search.rb3
-rw-r--r--lib/chef/knife/cookbook_site_share.rb3
-rw-r--r--lib/chef/knife/cookbook_site_show.rb3
-rw-r--r--lib/chef/knife/cookbook_site_unshare.rb3
-rw-r--r--lib/chef/knife/exec.rb3
-rw-r--r--lib/chef/knife/node_show.rb3
-rw-r--r--lib/chef/knife/serve.rb2
-rw-r--r--lib/chef/knife/ssl_check.rb3
-rw-r--r--lib/chef/log/winevt.rb3
-rw-r--r--lib/chef/policy_builder/policyfile.rb2
-rw-r--r--lib/chef/provider/file.rb2
-rw-r--r--lib/chef/provider/package/rubygems.rb5
-rw-r--r--lib/chef/provider/zypper_repository.rb3
-rw-r--r--lib/chef/resource/chef_handler.rb9
-rw-r--r--lib/chef/resource/cron_d.rb3
-rw-r--r--lib/chef/resource/dsc_resource.rb3
-rw-r--r--lib/chef/resource/dsc_script.rb3
-rw-r--r--lib/chef/resource/execute.rb4
-rw-r--r--lib/chef/resource/file.rb2
-rw-r--r--lib/chef/resource/locale.rb3
-rw-r--r--lib/chef/resource/reboot.rb3
-rw-r--r--lib/chef/resource/ssh_known_hosts_entry.rb3
-rw-r--r--lib/chef/resource/systemd_unit.rb3
-rw-r--r--lib/chef/resource/windows_ad_join.rb5
-rw-r--r--lib/chef/resource/windows_workgroup.rb5
-rw-r--r--spec/functional/event_loggers/windows_eventlog_spec.rb10
32 files changed, 68 insertions, 44 deletions
diff --git a/lib/chef/application/exit_code.rb b/lib/chef/application/exit_code.rb
index 7001cb1837..079cecf879 100644
--- a/lib/chef/application/exit_code.rb
+++ b/lib/chef/application/exit_code.rb
@@ -145,8 +145,8 @@ class Chef
def non_standard_exit_code_warning(exit_code)
"#{Chef::Dist::CLIENT} attempted to exit with a non-standard exit code of #{exit_code}." \
- " The Chef-Client Exit Codes design document (https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md)" \
- " defines the exit codes that should be used with Chef. Chef::Application::ExitCode defines" \
+ " The #{Chef::Dist::PRODUCT} Exit Codes design document (https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md)" \
+ " defines the exit codes that should be used with #{Chef::Dist::CLIENT}. Chef::Application::ExitCode defines" \
" valid exit codes Non-standard exit codes are redefined as GENERIC_FAILURE."
end
diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb
index e0f611590a..7111d975d5 100644
--- a/lib/chef/event_loggers/windows_eventlog.rb
+++ b/lib/chef/event_loggers/windows_eventlog.rb
@@ -19,6 +19,7 @@
require_relative "base"
require_relative "../platform/query_helpers"
require_relative "../win32/eventlog"
+require_relative "../dist"
class Chef
module EventLoggers
@@ -35,7 +36,7 @@ class Chef
LOG_CATEGORY_ID = 11001
# Since we must install the event logger, this is not really configurable
- SOURCE = "Chef".freeze
+ SOURCE = "#{Chef::Dist::PRODUCT}".freeze
def self.available?
Chef::Platform.windows?
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index d65d9da396..58f79311ab 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -177,7 +177,7 @@ class Chef
# client.rb content via bootstrap_context
option :bootstrap_no_proxy,
long: "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
- description: "Do not proxy locations for the node being bootstrapped; this option is used internally by Chef.",
+ description: "Do not proxy locations for the node being bootstrapped; this option is used internally by #{Chef::Dist::PRODUCT}.",
proc: Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }
# client.rb content via bootstrap_context
diff --git a/lib/chef/knife/cookbook_site_download.rb b/lib/chef/knife/cookbook_site_download.rb
index 655bf602a5..69ea827972 100644
--- a/lib/chef/knife/cookbook_site_download.rb
+++ b/lib/chef/knife/cookbook_site_download.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "supermarket_download"
+require_relative "../dist"
class Chef
class Knife
@@ -31,7 +32,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site download has been deprecated in favor of knife supermarket download. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site download has been deprecated in favor of knife supermarket download. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb
index badbcc9b98..31ca68847c 100644
--- a/lib/chef/knife/cookbook_site_install.rb
+++ b/lib/chef/knife/cookbook_site_install.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "supermarket_install"
+require_relative "../dist"
class Chef
class Knife
@@ -31,7 +32,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site install has been deprecated in favor of knife supermarket install. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site install has been deprecated in favor of knife supermarket install. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_list.rb b/lib/chef/knife/cookbook_site_list.rb
index 81e1ffc278..730e2a4ff1 100644
--- a/lib/chef/knife/cookbook_site_list.rb
+++ b/lib/chef/knife/cookbook_site_list.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "supermarket_list"
+require_relative "../dist"
class Chef
class Knife
@@ -31,7 +32,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site list has been deprecated in favor of knife supermarket list. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site list has been deprecated in favor of knife supermarket list. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_search.rb b/lib/chef/knife/cookbook_site_search.rb
index 8aa195fe22..090af1b339 100644
--- a/lib/chef/knife/cookbook_site_search.rb
+++ b/lib/chef/knife/cookbook_site_search.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "supermarket_search"
+require_relative "../dist"
class Chef
class Knife
@@ -31,7 +32,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site search has been deprecated in favor of knife supermarket search. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site search has been deprecated in favor of knife supermarket search. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb
index 99d9d612df..06b13eb0d9 100644
--- a/lib/chef/knife/cookbook_site_share.rb
+++ b/lib/chef/knife/cookbook_site_share.rb
@@ -19,6 +19,7 @@
require_relative "../knife"
require_relative "supermarket_share"
+require_relative "../dist"
class Chef
class Knife
@@ -32,7 +33,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site share has been deprecated in favor of knife supermarket share. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site share has been deprecated in favor of knife supermarket share. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_show.rb b/lib/chef/knife/cookbook_site_show.rb
index ef1f61a6ca..a1b5da833c 100644
--- a/lib/chef/knife/cookbook_site_show.rb
+++ b/lib/chef/knife/cookbook_site_show.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "supermarket_show"
+require_relative "../dist"
class Chef
class Knife
@@ -31,7 +32,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site show has been deprecated in favor of knife supermarket show. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site show has been deprecated in favor of knife supermarket show. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/cookbook_site_unshare.rb b/lib/chef/knife/cookbook_site_unshare.rb
index 13f02dd4d7..059587ac53 100644
--- a/lib/chef/knife/cookbook_site_unshare.rb
+++ b/lib/chef/knife/cookbook_site_unshare.rb
@@ -19,6 +19,7 @@
require_relative "../knife"
require_relative "supermarket_unshare"
+require_relative "../dist"
class Chef
class Knife
@@ -32,7 +33,7 @@ class Chef
category "deprecated"
def run
- Chef::Log.warn("knife cookbook site unshare has been deprecated in favor of knife supermarket unshare. In Chef 16 (April 2020) this will result in an error!")
+ Chef::Log.warn("knife cookbook site unshare has been deprecated in favor of knife supermarket unshare. In #{Chef::Dist::PRODUCT} 16 (April 2020) this will result in an error!")
super
end
diff --git a/lib/chef/knife/exec.rb b/lib/chef/knife/exec.rb
index 7a5d77abd5..4b7f570aec 100644
--- a/lib/chef/knife/exec.rb
+++ b/lib/chef/knife/exec.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "../util/path_helper"
+require_relative "../dist"
class Chef::Knife::Exec < Chef::Knife
@@ -26,7 +27,7 @@ class Chef::Knife::Exec < Chef::Knife
option :exec,
short: "-E CODE",
long: "--exec CODE",
- description: "A string of Chef code to execute."
+ description: "A string of #{Chef::Dist::PRODUCT} code to execute."
option :script_path,
short: "-p PATH:PATH",
diff --git a/lib/chef/knife/node_show.rb b/lib/chef/knife/node_show.rb
index d06e09d94e..57a4c35cee 100644
--- a/lib/chef/knife/node_show.rb
+++ b/lib/chef/knife/node_show.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "core/node_presenter"
+require_relative "../dist"
class Chef
class Knife
@@ -41,7 +42,7 @@ class Chef
option :environment,
short: "-E",
long: "--environment",
- description: "Show only the Chef environment."
+ description: "Show only the #{Chef::Dist::PRODUCT} environment."
def run
ui.use_presenter Knife::Core::NodePresenter
diff --git a/lib/chef/knife/serve.rb b/lib/chef/knife/serve.rb
index cf49621a88..4bef044e11 100644
--- a/lib/chef/knife/serve.rb
+++ b/lib/chef/knife/serve.rb
@@ -26,7 +26,7 @@ class Chef
option :repo_mode,
long: "--repo-mode MODE",
- description: "Specifies the local repository layout. Values: static (only environments/roles/data_bags/cookbooks), everything (includes nodes/clients/users), hosted_everything (includes acls/groups/etc. for Enterprise/Hosted Chef). Default: everything/hosted_everything."
+ description: "Specifies the local repository layout. Values: static (only environments/roles/data_bags/cookbooks), everything (includes nodes/clients/users), hosted_everything (includes acls/groups/etc. for Enterprise/Hosted #{Chef::Dist::PRODUCT}). Default: everything/hosted_everything."
option :chef_repo_path,
long: "--chef-repo-path PATH",
diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb
index 46a1f2f3b0..1668331ea4 100644
--- a/lib/chef/knife/ssl_check.rb
+++ b/lib/chef/knife/ssl_check.rb
@@ -18,6 +18,7 @@
require_relative "../knife"
require_relative "../config"
+require_relative "../dist"
class Chef
class Knife
@@ -233,7 +234,7 @@ class Chef
end
def debug_chef_ssl_config
- ui.err "Chef SSL Configuration:"
+ ui.err "#{Chef::Dist::PRODUCT} SSL Configuration:"
ui.err "* ssl_ca_path: #{configuration.ssl_ca_path.inspect}"
ui.err "* ssl_ca_file: #{configuration.ssl_ca_file.inspect}"
ui.err "* trusted_certs_dir: #{configuration.trusted_certs_dir.inspect}"
diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb
index aff3de7709..4affef78a3 100644
--- a/lib/chef/log/winevt.rb
+++ b/lib/chef/log/winevt.rb
@@ -19,6 +19,7 @@
require_relative "../event_loggers/base"
require_relative "../platform/query_helpers"
require_relative "../mixin/unformatter"
+require_relative "../dist"
class Chef
class Log
@@ -36,7 +37,7 @@ class Chef
FATAL_EVENT_ID = 10104
# Since we must install the event logger, this is not really configurable
- SOURCE = "Chef".freeze
+ SOURCE = Chef::Dist::PRODUCT.freeze
include Chef::Mixin::Unformatter
diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb
index cb120a0a03..353365941c 100644
--- a/lib/chef/policy_builder/policyfile.rb
+++ b/lib/chef/policy_builder/policyfile.rb
@@ -103,7 +103,7 @@ class Chef
end
if Chef::Config[:environment] && !Chef::Config[:environment].chomp.empty?
- raise UnsupportedFeature, "Policyfile does not work with Chef Environments."
+ raise UnsupportedFeature, "Policyfile does not work with #{Chef::Dist::PRODUCT} Environments."
end
end
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 2e48501e33..8c7055f107 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -230,7 +230,7 @@ class Chef
elsif file_class.symlink?(new_resource.path) && new_resource.manage_symlink_source.nil?
logger.warn("File #{path} managed by #{new_resource} is really a symlink (to #{file_class.realpath(new_resource.path)}). Managing the source file instead.")
logger.warn("Disable this warning by setting `manage_symlink_source true` on the resource")
- logger.warn("In a future Chef release, 'manage_symlink_source' will not be enabled by default")
+ logger.warn("In a future #{Chef::Dist::PRODUCT} release, 'manage_symlink_source' will not be enabled by default")
verify_symlink_sanity(path)
elsif new_resource.force_unlink
[nil, nil, nil]
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index e8b88437fb..8179deceed 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -22,6 +22,7 @@ require_relative "../package"
require_relative "../../resource/package"
require_relative "../../mixin/get_source_from_package"
require_relative "../../mixin/which"
+require_relative "../../dist"
# Class methods on Gem are defined in rubygems
require "rubygems" unless defined?(Gem)
@@ -400,8 +401,8 @@ class Chef
if new_resource.options && new_resource.options.is_a?(Hash)
msg = [
"Gem options must be passed to gem_package as a string instead of a hash when",
- "using this installation of Chef because it runs with its own packaged Ruby. A hash",
- "may only be used when installing a gem to the same Ruby installation that Chef is",
+ "using this installation of #{Chef::Dist::PRODUCT} because it runs with its own packaged Ruby. A hash",
+ "may only be used when installing a gem to the same Ruby installation that #{Chef::Dist::PRODUCT} is",
"running under. See https://docs.chef.io/resource_gem_package.html for more information.",
"Error raised at #{new_resource} from #{new_resource.source_line}",
].join("\n")
diff --git a/lib/chef/provider/zypper_repository.rb b/lib/chef/provider/zypper_repository.rb
index 8c1497b5f5..46d81430dd 100644
--- a/lib/chef/provider/zypper_repository.rb
+++ b/lib/chef/provider/zypper_repository.rb
@@ -21,6 +21,7 @@ require_relative "../dsl/declare_resource"
require_relative "noop"
require_relative "../mixin/shell_out"
require "shellwords" unless defined?(Shellwords)
+require_relative "../dist"
class Chef
class Provider
@@ -111,7 +112,7 @@ class Chef
logger.trace("Will use :cookbook_file resource to cache the gpg key locally")
:cookbook_file
else
- raise Chef::Exceptions::FileNotFound, "Cannot determine location of gpgkey. Must start with 'http' or be a file managed by Chef."
+ raise Chef::Exceptions::FileNotFound, "Cannot determine location of gpgkey. Must start with 'http' or be a file managed by #{Chef::Dist::PRODUCT}."
end
end
diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb
index 70174e2cce..e6ff27c157 100644
--- a/lib/chef/resource/chef_handler.rb
+++ b/lib/chef/resource/chef_handler.rb
@@ -16,6 +16,7 @@
#
require_relative "../resource"
+require_relative "../dist"
class Chef
class Resource
@@ -23,7 +24,7 @@ class Chef
resource_name :chef_handler
provides(:chef_handler) { true }
- description "Use the chef_handler resource to install or uninstall Chef reporting/exception handlers."
+ description "Use the chef_handler resource to install or uninstall reporting/exception handlers."
introduced "14.0"
property :class_name, String,
@@ -38,7 +39,7 @@ class Chef
default: lazy { [] }
property :type, Hash,
- description: "The type of Chef Handler to register as, i.e. :report, :exception or both.",
+ description: "The type of handler to register as, i.e. :report, :exception or both.",
default: { report: true, exception: true }
# supports means a different thing in chef-land so we renamed it but
@@ -48,7 +49,7 @@ class Chef
# This action needs to find an rb file that presumably contains the indicated class in it and the
# load that file. It then instantiates that class by name and registers it as a handler.
action :enable do
- description "Enables the Chef handler for the current Chef run on the current node"
+ description "Enables the handler for the current #{Chef::Dist::PRODUCT} run on the current node"
class_name = new_resource.class_name
new_resource.type.each do |type, enable|
@@ -71,7 +72,7 @@ class Chef
end
action :disable do
- description "Disables the Chef handler for the current Chef run on the current node"
+ description "Disables the handler for the current #{Chef::Dist::PRODUCT} run on the current node"
new_resource.type.each_key do |type|
unregister_handler(type, new_resource.class_name)
diff --git a/lib/chef/resource/cron_d.rb b/lib/chef/resource/cron_d.rb
index fe3ef4914c..c58de5285c 100644
--- a/lib/chef/resource/cron_d.rb
+++ b/lib/chef/resource/cron_d.rb
@@ -17,6 +17,7 @@
require_relative "../resource"
require "shellwords" unless defined?(Shellwords)
+require_relative "../dist"
class Chef
class Resource
@@ -162,7 +163,7 @@ class Chef
# warn if someone passes the deprecated cookbook property
def after_created
- raise ArgumentError, "The 'cookbook' property for the cron_d resource is no longer supported now that this resource ships in Chef itself." if cookbook
+ raise ArgumentError, "The 'cookbook' property for the cron_d resource is no longer supported now that this resource ships in #{Chef::Dist::PRODUCT} itself." if cookbook
end
action :create do
diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb
index a378b6f685..5df4cae498 100644
--- a/lib/chef/resource/dsc_resource.rb
+++ b/lib/chef/resource/dsc_resource.rb
@@ -16,6 +16,7 @@
# limitations under the License.
#
require_relative "../dsl/powershell"
+require_relative "../dist"
class Chef
class Resource
@@ -23,7 +24,7 @@ class Chef
resource_name :dsc_resource
provides :dsc_resource
- description "The dsc_resource resource allows any DSC resource to be used in a Chef recipe, as well as any custom resources that have been added to your Windows PowerShell environment. Microsoft frequently adds new resources to the DSC resource collection."
+ description "The dsc_resource resource allows any DSC resource to be used in a #{Chef::Dist::PRODUCT} recipe, as well as any custom resources that have been added to your Windows PowerShell environment. Microsoft frequently adds new resources to the DSC resource collection."
introduced "12.2"
# This class will check if the object responds to
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index e1eab63fcc..684cbc4e0c 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -19,6 +19,7 @@
require_relative "../resource"
require_relative "../exceptions"
require_relative "../dsl/powershell"
+require_relative "../dist"
class Chef
class Resource
@@ -28,7 +29,7 @@ class Chef
resource_name :dsc_script
provides :dsc_script
- description "Many DSC resources are comparable to built-in Chef resources. For example, both DSC and Chef have file, package, and service resources. The dsc_script resource is most useful for those DSC resources that do not have a direct comparison to a resource in Chef, such as the Archive resource, a custom DSC resource, an existing DSC script that performs an important task, and so on. Use the dsc_script resource to embed the code that defines a DSC configuration directly within a Chef recipe."
+ description "Many DSC resources are comparable to built-in #{Chef::Dist::PRODUCT} resources. For example, both DSC and #{Chef::Dist::PRODUCT} have file, package, and service resources. The dsc_script resource is most useful for those DSC resources that do not have a direct comparison to a resource in #{Chef::Dist::PRODUCT}, such as the Archive resource, a custom DSC resource, an existing DSC script that performs an important task, and so on. Use the dsc_script resource to embed the code that defines a DSC configuration directly within a #{Chef::Dist::PRODUCT} recipe."
default_action :run
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 211caef0a1..d61ed20662 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -85,7 +85,7 @@ class Chef
property :domain, String,
introduced: "12.21",
- description: "Windows only: The domain of the user user specified by the user property. If not specified, the user name and password specified by the user and password properties will be used to resolve that user against the domain in which the system running Chef client is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property."
+ description: "Windows only: The domain of the user user specified by the user property. If not specified, the user name and password specified by the user and password properties will be used to resolve that user against the domain in which the system running #{Chef::Dist::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property."
property :password, String, sensitive: true,
introduced: "12.21",
@@ -97,7 +97,7 @@ class Chef
default: lazy { |r| r.password ? true : false }, default_description: "True if the password property is set. False otherwise."
property :elevated, [ TrueClass, FalseClass ], default: false,
- description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running Chef needs the “Replace a process level token” and “Adjust Memory Quotas for a process” permissions. The user that is running the command needs the “Log on as a batch job” permission.\nBecause this requires a login, the user and password properties are required.",
+ description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running #{Chef::Dist::CLIENT} needs the “Replace a process level token” and “Adjust Memory Quotas for a process” permissions. The user that is running the command needs the “Log on as a batch job” permission.\nBecause this requires a login, the user and password properties are required.",
introduced: "13.3"
alias :env :environment
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index c034774257..310cd91830 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -73,7 +73,7 @@ class Chef
description: "How the #{Chef::Dist::CLIENT} handles certain situations when the target file turns out not to be a file. For example, when a target file is actually a symlink. Set to true for the #{Chef::Dist::CLIENT} delete the non-file target and replace it with the specified file. Set to false for the #{Chef::Dist::CLIENT} to raise an error."
property :manage_symlink_source, [ TrueClass, FalseClass ], desired_state: false,
- description: "Change the behavior of the file resource if it is pointed at a symlink. When this value is set to true, the Chef client will manage the symlink's permissions or will replace the symlink with a normal file if the resource has content. When this value is set to false, Chef will follow the symlink and will manage the permissions and content of symlink's target file. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning."
+ description: "Change the behavior of the file resource if it is pointed at a symlink. When this value is set to true, the Chef client will manage the symlink's permissions or will replace the symlink with a normal file if the resource has content. When this value is set to false, #{Chef::Dist::PRODUCT} will follow the symlink and will manage the permissions and content of symlink's target file. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning."
property :verifications, Array, default: lazy { [] }
diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb
index 7331a5a36c..73a67f215e 100644
--- a/lib/chef/resource/locale.rb
+++ b/lib/chef/resource/locale.rb
@@ -16,6 +16,7 @@
#
require_relative "../resource"
+require_relative "../dist"
class Chef
class Resource
@@ -59,7 +60,7 @@ class Chef
#
def lc_all(arg = nil)
unless arg.nil?
- Chef.deprecated(:locale_lc_all, "Changing LC_ALL can break Chef's parsing of command output in unexpected ways.\n Use one of the more specific LC_ properties as needed.")
+ Chef.deprecated(:locale_lc_all, "Changing LC_ALL can break #{Chef::Dist::PRODUCT}'s parsing of command output in unexpected ways.\n Use one of the more specific LC_ properties as needed.")
end
end
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 21efdf2b6f..f3f77780f9 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -17,6 +17,7 @@
#
require_relative "../resource"
+require_relative "../dist"
class Chef
class Resource
@@ -36,7 +37,7 @@ class Chef
property :reason, String,
description: "A string that describes the reboot action.",
- default: "Reboot by Chef"
+ default: "Reboot by #{Chef::Dist::PRODUCT}"
property :delay_mins, Integer,
description: "The amount of time (in minutes) to delay a reboot request.",
diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb
index 4069c3da5e..bf36560c51 100644
--- a/lib/chef/resource/ssh_known_hosts_entry.rb
+++ b/lib/chef/resource/ssh_known_hosts_entry.rb
@@ -18,6 +18,7 @@
# limitations under the License.
require_relative "../resource"
+require_relative "../dist"
class Chef
class Resource
@@ -111,7 +112,7 @@ class Chef
# all this does is send an immediate run_action(:create) to the template resource
action :flush do
- description "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the Chef run so all entries can be accumulated before writing the file out."
+ description "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the #{Chef::Dist::PRODUCT} run so all entries can be accumulated before writing the file out."
with_run_context :root do
# if you haven't ever called ssh_known_hosts_entry before you're definitely doing it wrong so we blow up hard.
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb
index db4c1dabad..b64a22af47 100644
--- a/lib/chef/resource/systemd_unit.rb
+++ b/lib/chef/resource/systemd_unit.rb
@@ -17,6 +17,7 @@
#
require_relative "../resource"
+require_relative "../dist"
require "iniparse"
class Chef
@@ -48,7 +49,7 @@ class Chef
description: "The user account that the systemd unit process is run under. The path to the unit for that user would be something like '/etc/systemd/user/sshd.service'. If no user account is specified, the systemd unit will run under a 'system' account, with the path to the unit being something like '/etc/systemd/system/sshd.service'."
property :content, [String, Hash],
- description: "A string or hash that contains a systemd `unit file <https://www.freedesktop.org/software/systemd/man/systemd.unit.html>`_ definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In Chef 14.4 or later, repeatable options can be implemented with an array."
+ description: "A string or hash that contains a systemd `unit file <https://www.freedesktop.org/software/systemd/man/systemd.unit.html>`_ definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In #{Chef::Dist::PRODUCT} 14.4 or later, repeatable options can be implemented with an array."
property :triggers_reload, [TrueClass, FalseClass],
description: "Specifies whether to trigger a daemon reload when creating or deleting a unit.",
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb
index b31ae036ae..a7f205841c 100644
--- a/lib/chef/resource/windows_ad_join.rb
+++ b/lib/chef/resource/windows_ad_join.rb
@@ -17,6 +17,7 @@
require_relative "../resource"
require_relative "../mixin/powershell_out"
+require_relative "../dist"
class Chef
class Resource
@@ -48,8 +49,8 @@ class Chef
property :reboot, Symbol,
equal_to: [:immediate, :delayed, :never, :request_reboot, :reboot_now],
- validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the Chef run completes), and :never (Don't reboot)",
- description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the Chef run completes, or never. Note that a reboot is necessary for changes to take effect.",
+ validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)",
+ description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
default: :immediate
property :new_hostname, String,
diff --git a/lib/chef/resource/windows_workgroup.rb b/lib/chef/resource/windows_workgroup.rb
index 2b9286813e..4c96f13738 100644
--- a/lib/chef/resource/windows_workgroup.rb
+++ b/lib/chef/resource/windows_workgroup.rb
@@ -17,6 +17,7 @@
require_relative "../resource"
require_relative "../mixin/powershell_out"
+require_relative "../dist"
class Chef
class Resource
@@ -45,8 +46,8 @@ class Chef
property :reboot, Symbol,
equal_to: [:never, :request_reboot, :reboot_now],
- validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the Chef run completes), and :never (Don't reboot)",
- description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the Chef run completes, or never. Note that a reboot is necessary for changes to take effect.",
+ validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)",
+ description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.",
coerce: proc { |x| clarify_reboot(x) },
default: :immediate, desired_state: false
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb
index fa84e96c25..c1e5150428 100644
--- a/spec/functional/event_loggers/windows_eventlog_spec.rb
+++ b/spec/functional/event_loggers/windows_eventlog_spec.rb
@@ -49,7 +49,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_start(version, run_status)
expect(event_log.read(flags, offset).any? do |e|
- e.source == "Chef" && e.event_id == 10000 &&
+ e.source == Chef::Dist::PRODUCT && e.event_id == 10000 &&
e.string_inserts[0].include?(version) end).to be_truthy
end
@@ -57,7 +57,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_started(run_status)
expect(event_log.read(flags, offset).any? do |e|
- e.source == "Chef" && e.event_id == 10001 &&
+ e.source == Chef::Dist::PRODUCT && e.event_id == 10001 &&
e.string_inserts[0].include?(run_id) end).to be_truthy
end
@@ -66,7 +66,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_completed(node)
expect(event_log.read(flags, offset).any? do |e|
- e.source == "Chef" && e.event_id == 10002 &&
+ e.source == Chef::Dist::PRODUCT && e.event_id == 10002 &&
e.string_inserts[0].include?(run_id) &&
e.string_inserts[1].include?(elapsed_time.to_s)
end).to be_truthy
@@ -77,7 +77,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_failed(mock_exception)
expect(event_log.read(flags, offset).any? do |e|
- e.source == "Chef" && e.event_id == 10003 &&
+ e.source == Chef::Dist::PRODUCT && e.event_id == 10003 &&
e.string_inserts[0].include?(run_id) &&
e.string_inserts[1].include?(elapsed_time.to_s) &&
e.string_inserts[2].include?(mock_exception.class.name) &&
@@ -91,7 +91,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do
logger.run_failed(mock_exception)
expect(event_log.read(flags, offset).any? do |e|
- e.source == "Chef" && e.event_id == 10003 &&
+ e.source == Chef::Dist::PRODUCT && e.event_id == 10003 &&
e.string_inserts[0].include?("UNKNOWN") &&
e.string_inserts[1].include?("UNKNOWN") &&
e.string_inserts[2].include?(mock_exception.class.name) &&