summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data_collection.json2
-rw-r--r--lib/chef/data_collector.rb12
2 files changed, 7 insertions, 7 deletions
diff --git a/data_collection.json b/data_collection.json
new file mode 100644
index 0000000000..139597f9cb
--- /dev/null
+++ b/data_collection.json
@@ -0,0 +1,2 @@
+
+
diff --git a/lib/chef/data_collector.rb b/lib/chef/data_collector.rb
index 1c2a83337d..6d8b3d6e5f 100644
--- a/lib/chef/data_collector.rb
+++ b/lib/chef/data_collector.rb
@@ -351,18 +351,16 @@ class Chef
def send_to_output_locations(message)
data_collector_output_locations.each do |type, location_list|
- method = if type == :urls
- method(:send_to_http_location)
- elsif type == :files
- method(:send_to_file_location)
- end
-
location_list.each do |l|
- method.call(l, message)
+ handle_output_location(type, l, message)
end
end
end
+ def handle_output_location(type, loc, message)
+ type == :urls ? send_to_http_location(loc, message) : send_to_file_location(loc, message)
+ end
+
def send_to_file_location(file_name, message)
open(file_name, "a") { |f| f.puts message }
end