summaryrefslogtreecommitdiff
path: root/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/formatters/error_inspectors/node_load_error_inspector.rb')
-rw-r--r--lib/chef/formatters/error_inspectors/node_load_error_inspector.rb19
1 files changed, 7 insertions, 12 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 b3196caddb..b1e883e2b5 100644
--- a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb
@@ -21,12 +21,9 @@ require "chef/formatters/error_inspectors/api_error_formatting"
class Chef
module Formatters
module ErrorInspectors
-
-
# == APIErrorInspector
# Wraps exceptions caused by API calls to the server.
class NodeLoadErrorInspector
-
include APIErrorFormatting
attr_reader :exception
@@ -44,11 +41,11 @@ class Chef
when Net::HTTPServerException, Net::HTTPFatalError
humanize_http_exception(error_description)
when Chef::Exceptions::PrivateKeyMissing
- error_description.section("Private Key Not Found:",<<-E)
+ 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-client.
E
- error_description.section("Relevant Config Settings:",<<-E)
+ error_description.section("Relevant Config Settings:", <<-E)
client_key "#{api_key}"
E
when EOFError
@@ -56,7 +53,7 @@ E
when *NETWORK_ERROR_CLASSES
describe_network_errors(error_description)
else
- error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}")
+ error_description.section("Unexpected Error:", "#{exception.class.name}: #{exception.message}")
end
end
@@ -70,12 +67,12 @@ E
# TODO: we're rescuing errors from Node.find_or_create
# * could be no write on nodes container
# * could be no read on the node
- error_description.section("Authorization Error",<<-E)
+ error_description.section("Authorization Error", <<-E)
Your client is not authorized to load the node data (HTTP 403).
E
error_description.section("Server Response:", format_rest_error)
- error_description.section("Possible Causes:",<<-E)
+ error_description.section("Possible Causes:", <<-E)
* Your client (#{username}) may have misconfigured authorization permissions.
E
when Net::HTTPBadRequest
@@ -98,10 +95,10 @@ E
# one, e.g., PUT http://wrong.url/nodes/node-name becomes a GET after a
# redirect.
def describe_404_error(error_description)
- error_description.section("Resource Not Found:",<<-E)
+ error_description.section("Resource Not Found:", <<-E)
The server returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
E
- error_description.section("Relevant Config Settings:",<<-E)
+ error_description.section("Relevant Config Settings:", <<-E)
chef_server_url "#{server_url}"
E
end
@@ -121,9 +118,7 @@ E
def clock_skew?
exception.response.body =~ /synchronize the clock/i
end
-
end
-
end
end
end