summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTensibai <tensibai@iabis.net>2019-05-02 22:03:04 +0000
committerTensibai <tensibai@iabis.net>2019-05-02 22:03:04 +0000
commit61b913af34f1b769eaf2281145beed3f591c2f7e (patch)
tree727386e4e3d5f797b9af619be34e4395db44c23b
parentbb3fb62a356e75b5582d1e03d5343be82de34b54 (diff)
downloadchef-61b913af34f1b769eaf2281145beed3f591c2f7e.tar.gz
Reload the changes, adapt a bit
Signed-off-by: Tensibai <tensibai@iabis.net>
-rw-r--r--lib/chef/dist.rb2
-rw-r--r--lib/chef/formatters/doc.rb11
-rw-r--r--lib/chef/formatters/error_inspectors/api_error_formatting.rb6
-rw-r--r--lib/chef/formatters/minimal.rb7
-rw-r--r--lib/chef/knife.rb6
-rw-r--r--lib/chef/knife/bootstrap.rb3
6 files changed, 19 insertions, 16 deletions
diff --git a/lib/chef/dist.rb b/lib/chef/dist.rb
index 51dd03e965..f4b1d12c5f 100644
--- a/lib/chef/dist.rb
+++ b/lib/chef/dist.rb
@@ -2,7 +2,7 @@ class Chef
class Dist
# This class is not fully implemented, depending on it is not recommended!
# When referencing a product directly, like Chef (Now Chef Infra)
- PRODUCT = "Chef Infra".freeze
+ PRODUCT = "Chef Infra Client".freeze
# The client's alias (chef-client)
CLIENT = "chef-client".freeze
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index 0b0a589d56..1fdbb66b1b 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -1,5 +1,6 @@
require "chef/formatters/base"
require "chef/config"
+require "chef/dist"
class Chef
module Formatters
@@ -40,7 +41,7 @@ class Chef
end
def run_start(version, run_status)
- puts_line "Starting Chef Client, version #{version}"
+ puts_line "Starting #{Chef::Dist::PRODUCT}, version #{version}"
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
end
@@ -75,18 +76,18 @@ class Chef
puts_line ""
end
if Chef::Config[:why_run]
- puts_line "Chef Client finished, #{@updated_resources}/#{total_resources} resources would have been updated"
+ puts_line "#{Chef::Dist::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources would have been updated"
else
- puts_line "Chef Client finished, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "#{Chef::Dist::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
end
end
def run_failed(exception)
@end_time = Time.now
if Chef::Config[:why_run]
- puts_line "Chef Client failed. #{@updated_resources} resources would have been updated"
+ puts_line "#{Chef::Dist::PRODUCT} failed. #{@updated_resources} resources would have been updated"
else
- puts_line "Chef Client failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "#{Chef::Dist::PRODUCT} failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
end
end
diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
index e74c353ba9..b94545ab48 100644
--- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb
+++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
@@ -112,10 +112,10 @@ class Chef
max_server_version = version_header["max_version"]
error_description.section("Incompatible server API version:", <<~E)
- This version of the API that this Chef request specified is not supported by the Chef server you sent this request to.
+ This version of the API that this request specified is not supported by the server you sent this request to.
The server supports a min API version of #{min_server_version} and a max API version of #{max_server_version}.
- Chef just made a request with an API version of #{client_api_version}.
- Please either update your Chef client or server to be a compatible set.
+ #{Chef::Dist::PRODUCT} just made a request with an API version of #{client_api_version}.
+ Please either update your #{Chef::Dist::PRODUCT} or the server to be a compatible set.
E
else
describe_http_error(error_description)
diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb
index e182189f7d..6b12be71b7 100644
--- a/lib/chef/formatters/minimal.rb
+++ b/lib/chef/formatters/minimal.rb
@@ -1,4 +1,5 @@
require "chef/formatters/base"
+require "chef/dist"
class Chef
@@ -27,18 +28,18 @@ class Chef
# Called at the very start of a Chef Run
def run_start(version, run_status)
- puts_line "Starting Chef Client, version #{version}"
+ puts_line "Starting #{Chef::Dist::PRODUCT}, version #{version}"
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
end
# Called at the end of the Chef run.
def run_completed(node)
- puts "chef client finished, #{@updated_resources.size} resources updated"
+ puts "#{Chef::Dist::PRODUCT} finished, #{@updated_resources.size} resources updated"
end
# called at the end of a failed run
def run_failed(exception)
- puts "chef client failed. #{@updated_resources.size} resources updated"
+ puts "#{Chef::Dist::PRODUCT} failed. #{@updated_resources.size} resources updated"
end
# Called right after ohai runs.
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index 08224b37e1..da9c1ab1e9 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -474,7 +474,7 @@ class Chef
when OpenSSL::SSL::SSLError
ui.error "Could not establish a secure connection to the server."
ui.info "Use `knife ssl check` to troubleshoot your SSL configuration."
- ui.info "If your #{Chef::Dist::PRODUCT} Server uses a self-signed certificate, you can use"
+ ui.info "If your server uses a self-signed certificate, you can use"
ui.info "`knife ssl fetch` to make knife trust the server's certificates."
ui.info ""
ui.info "Original Exception: #{e.class.name}: #{e.message}"
@@ -507,7 +507,7 @@ class Chef
ui.error "You authenticated successfully to #{server_url} as #{username} but you are not authorized for this action."
proxy_env_vars = ENV.to_hash.keys.map(&:downcase) & %w{http_proxy https_proxy ftp_proxy socks_proxy no_proxy}
unless proxy_env_vars.empty?
- ui.error "There are proxy servers configured, your #{Chef::Dist::PRODUCT} server may need to be added to NO_PROXY."
+ ui.error "There are proxy servers configured, your server url may need to be added to NO_PROXY."
end
ui.info "Response: #{format_rest_error(response)}"
when Net::HTTPBadRequest
@@ -530,7 +530,7 @@ class Chef
client_api_version = version_header["request_version"]
min_server_version = version_header["min_version"]
max_server_version = version_header["max_version"]
- ui.error "The version of #{Chef::Dist::PRODUCT} API that Knife is using is not supported by the server you sent this request to."
+ ui.error "The API version that Knife is using is not supported by the server you sent this request to."
ui.info "The request that Knife sent was using API version #{client_api_version}."
ui.info "The server you sent the request to supports a min API verson of #{min_server_version} and a max API version of #{max_server_version}."
ui.info "Please either update your #{Chef::Dist::PRODUCT} or the server to be a compatible set."
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index e879c2e822..43f6e9a023 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -18,6 +18,7 @@
require "chef/knife"
require "chef/knife/data_bag_secret_options"
+require "chef/dist"
class Chef
class Knife
@@ -286,7 +287,7 @@ class Chef
option :msi_url, # Windows target only
short: "-m URL",
long: "--msi-url URL",
- description: "Location of the Chef Client MSI. The default templates will prefer to download from this location. The MSI will be downloaded from chef.io if not provided (windows).",
+ description: "Location of the #{Chef::Dist::PRODUCT} MSI. The default templates will prefer to download from this location. The MSI will be downloaded from chef.io if not provided (windows).",
default: ""
# bootstrap override: Do this instead of our own setup.sh from omnitruck. Causes bootstrap_url to be ignored.