summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-05-08 08:25:56 -0700
committerTim Smith <tsmith84@gmail.com>2020-05-22 09:37:27 -0700
commitf707797029b0fc087bd0dd5640dac35c04f27e97 (patch)
treee36c3fc17198b696c08430ae01e01186501d69b9
parent51e79f5501dad23a074ed8188e93a46484880e70 (diff)
downloadchef-f707797029b0fc087bd0dd5640dac35c04f27e97.tar.gz
Use the dist values in server error messages
Improves the branding here and makes sure this displays correctly for cinc Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/formatters/error_inspectors/node_load_error_inspector.rb4
-rw-r--r--lib/chef/formatters/error_inspectors/registration_error_inspector.rb14
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
index 58e6acbea9..3a3f602203 100644
--- a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
@@ -46,7 +46,7 @@ class Chef
when Chef::Exceptions::PrivateKeyMissing
error_description.section("Private Key Not Found:", <<~E)
Your private key could not be loaded. If the key file exists, ensure that it is
- readable by #{Chef::Dist::CLIENT}.
+ readable by #{Chef::Dist::PRODUCT}.
E
error_description.section("Relevant Config Settings:", <<~E)
client_key "#{api_key}"
@@ -99,7 +99,7 @@ class Chef
# redirect.
def describe_404_error(error_description)
error_description.section("Resource Not Found:", <<~E)
- The server returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
+ The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
E
error_description.section("Relevant Config Settings:", <<~E)
chef_server_url "#{server_url}"
diff --git a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
index 388e6af20d..565ea217b8 100644
--- a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
@@ -28,7 +28,7 @@ class Chef
humanize_http_exception(error_description)
when Errno::ECONNREFUSED, Timeout::Error, Errno::ETIMEDOUT, SocketError
error_description.section("Network Error:", <<~E)
- There was a network error connecting to the Chef Server:
+ There was a network error connecting to the #{Chef::Dist::SERVER_PRODUCT}:
#{exception.message}
E
error_description.section("Relevant Config Settings:", <<~E)
@@ -39,14 +39,14 @@ class Chef
when Chef::Exceptions::PrivateKeyMissing
error_description.section("Private Key Not Found:", <<~E)
Your private key could not be loaded. If the key file exists, ensure that it is
- readable by #{Chef::Dist::CLIENT}.
+ readable by #{Chef::Dist::PRODUCT}.
E
error_description.section("Relevant Config Settings:", <<~E)
validation_key "#{api_key}"
E
when Chef::Exceptions::InvalidRedirect
error_description.section("Invalid Redirect:", <<~E)
- Change your server location in client.rb to the server's FQDN to avoid unwanted redirections.
+ Change your #{Chef::Dist::SERVER_PRODUCT} location in client.rb to the #{Chef::Dist::SERVER_PRODUCT}'s FQDN to avoid unwanted redirections.
E
when EOFError
describe_eof_error(error_description)
@@ -61,13 +61,13 @@ class Chef
when Net::HTTPUnauthorized
if clock_skew?
error_description.section("Authentication Error:", <<~E)
- Failed to authenticate to the chef server (http 401).
+ Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
The request failed because your clock has drifted by more than 15 minutes.
Syncing your clock to an NTP Time source should resolve the issue.
E
else
error_description.section("Authentication Error:", <<~E)
- Failed to authenticate to the chef server (http 401).
+ Failed to authenticate to the #{Chef::Dist::SERVER_PRODUCT} (http 401).
E
error_description.section("Server Response:", format_rest_error)
@@ -81,7 +81,7 @@ class Chef
end
when Net::HTTPForbidden
error_description.section("Authorization Error:", <<~E)
- Your validation client is not authorized to create the client for this node (HTTP 403).
+ Your validation client is not authorized to create the client for this node on the #{Chef::Dist::SERVER_PRODUCT} (HTTP 403).
E
error_description.section("Possible Causes:", <<~E)
* There may already be a client named "#{config[:node_name]}"
@@ -94,7 +94,7 @@ class Chef
error_description.section("Server Response:", format_rest_error)
when Net::HTTPNotFound
error_description.section("Resource Not Found:", <<~E)
- The server returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
+ The #{Chef::Dist::SERVER_PRODUCT} returned a HTTP 404. This usually indicates that your chef_server_url configuration is incorrect.
E
error_description.section("Relevant Config Settings:", <<~E)
chef_server_url "#{server_url}"