summaryrefslogtreecommitdiff
path: root/lib/chef/data_collector
diff options
context:
space:
mode:
authorAdam Leff <adam@leff.co>2016-07-01 15:48:51 -0400
committerAdam Leff <adam@leff.co>2016-07-03 13:26:01 -0400
commit1e70e7912bcc23a53673a69bf411b607d4085eff (patch)
tree65a6c4e4f18422f4b69c02ca0cf8118f11c1fedb /lib/chef/data_collector
parent741ac9dde480a934f2f4fc98ada2ffa7ad4f71c0 (diff)
downloadchef-1e70e7912bcc23a53673a69bf411b607d4085eff.tar.gz
Data Collector server URL validation, and disable on host down
If a user configured data_collector.server_url in their Chef config as an empty string, we blissfully passed it along to Chef::HTTP which would eventually raise a TypeError when trying to dup the URI's host. This change validates the server_url when setting up the Data Collector and gives helpful error messages to the user. We also count Errno::EHOSTDOWN as an error worthy of disabling the Data Collector reporter for a given run if the user so chooses.
Diffstat (limited to 'lib/chef/data_collector')
-rw-r--r--lib/chef/data_collector/resource_report.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/chef/data_collector/resource_report.rb b/lib/chef/data_collector/resource_report.rb
index e031d4bcb6..dcaf9c8e44 100644
--- a/lib/chef/data_collector/resource_report.rb
+++ b/lib/chef/data_collector/resource_report.rb
@@ -80,6 +80,7 @@ class Chef
if new_resource.cookbook_name
hash["cookbook_name"] = new_resource.cookbook_name
hash["cookbook_version"] = new_resource.cookbook_version.version
+ hash["recipe_name"] = new_resource.recipe_name
end
hash["conditional"] = conditional.to_text if status == "skipped"