summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTensibai <tensibai@iabis.net>2019-09-26 14:43:19 +0200
committerTensibai <tensibai@iabis.net>2019-09-26 17:11:24 +0200
commita6d32a9b9e69aa8b5e0a37f6555c5c5b639b36c2 (patch)
tree2da5ba50f68481683ffe412097a148b0905d23e8
parent49ff9da07c01255c36650ca55874ac067c0e68bd (diff)
downloadchef-a6d32a9b9e69aa8b5e0a37f6555c5c5b639b36c2.tar.gz
Fix some places where constants from dist.rb were not used. Specifically for chef-shell
Signed-off-by: Tensibai <tensibai@iabis.net>
-rw-r--r--lib/chef/knife/ssl_check.rb2
-rw-r--r--lib/chef/resource/cookbook_file.rb2
-rw-r--r--lib/chef/shell.rb8
-rw-r--r--lib/chef/shell/ext.rb4
-rw-r--r--lib/chef/train_transport.rb2
5 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb
index 1668331ea4..f6e68ebe45 100644
--- a/lib/chef/knife/ssl_check.rb
+++ b/lib/chef/knife/ssl_check.rb
@@ -190,7 +190,7 @@ class Chef
#{ui.color("TO FIX THIS ERROR:", :bold)}
If the server you are connecting to uses a self-signed certificate, you must
- configure chef to trust that server's certificate.
+ configure #{Chef::Dist::PRODUCT} to trust that server's certificate.
By default, the certificate is stored in the following location on the host
where your chef-server runs:
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb
index cb1af567ab..aacd86e772 100644
--- a/lib/chef/resource/cookbook_file.rb
+++ b/lib/chef/resource/cookbook_file.rb
@@ -30,7 +30,7 @@ class Chef
resource_name :cookbook_file
- description "Use the cookbook_file resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{Chef::Dist::CLIENT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{Chef::Dist::CLIENT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the Chef server. A file is not transferred when the checksums match. Only files that require an update are transferred from the Chef server to a node."
+ description "Use the cookbook_file resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{Chef::Dist::CLIENT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{Chef::Dist::CLIENT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the #{Chef::Dist::SERVER_PRODUCT}. A file is not transferred when the checksums match. Only files that require an update are transferred from the #{Chef::Dist::SERVER_PRODUCT} to a node."
property :source, [ String, Array ],
description: "The name of the file in COOKBOOK_NAME/files/default or the path to a file located in COOKBOOK_NAME/files. The path must include the file name and its extension. This can be used to distribute specific files depending upon the platform used.",
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index d81b2eb910..68c286abb1 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -121,11 +121,11 @@ module Shell
irb_conf[:IRB_RC] = lambda do |conf|
m = conf.main
- conf.prompt_c = "chef#{leader(m)} > "
+ conf.prompt_c = "#{Chef::Dist::EXEC}#{leader(m)} > "
conf.return_format = " => %s \n"
- conf.prompt_i = "chef#{leader(m)} (#{Chef::VERSION})> "
- conf.prompt_n = "chef#{leader(m)} ?> "
- conf.prompt_s = "chef#{leader(m)}%l> "
+ conf.prompt_i = "#{Chef::Dist::EXEC}#{leader(m)} (#{Chef::VERSION})> "
+ conf.prompt_n = "#{Chef::Dist::EXEC}#{leader(m)} ?> "
+ conf.prompt_s = "#{Chef::Dist::EXEC}#{leader(m)}%l> "
conf.use_tracer = false
end
end
diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb
index 843126b4f2..b62b87ac6d 100644
--- a/lib/chef/shell/ext.rb
+++ b/lib/chef/shell/ext.rb
@@ -211,8 +211,8 @@ module Shell
desc "prints information about chef"
def version
puts "This is the #{Chef::Dist::SHELL}.\n" +
- " Chef Version: #{::Chef::VERSION}\n" +
- " https://www.chef.io/\n" +
+ " #{Chef::Dist::PRODUCT} Version: #{::Chef::VERSION}\n" +
+ " #{Chef::Dist::WEBSITE}\n" +
" https://docs.chef.io/"
:ucanhaz_automation
end
diff --git a/lib/chef/train_transport.rb b/lib/chef/train_transport.rb
index accaa6355b..6a82e8620e 100644
--- a/lib/chef/train_transport.rb
+++ b/lib/chef/train_transport.rb
@@ -100,7 +100,7 @@ class Chef
tm_config = Chef::Config.target_mode
protocol = tm_config.protocol
train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
- Chef::Log.trace("Using target mode options from Chef config file: #{train_config.keys.join(", ")}") if train_config
+ Chef::Log.trace("Using target mode options from #{Chef::Dist::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
# Load the credentials file, and place any valid settings into the train configuration
credentials = load_credentials(tm_config.host)