Skip to content

Commit 939afae

Browse files
authored
Merge pull request #108 from edward-harley/fix_failed_nodes_report
Fix failed nodes report
2 parents dedafb4 + d0f2769 commit 939afae

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/puppet/catalog-diff/compilecatalog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def compile_catalog(node_name, server, certless, tls_cert, tls_key, tls_ca, deri
116116
else
117117
Puppet.runtime[:http].get(uri, headers: headers, options: { ssl_context: ssl_context })
118118
end
119-
raise "HTTP request to Puppetserver #{server} failed with: HTTP #{ret.code} - #{ret.reason}" unless ret.success?
119+
raise "HTTP request to Puppetserver #{server} failed with: HTTP #{ret.code} - #{ret.body}" unless ret.success?
120120
rescue Exception => e
121121
raise "Failed to retrieve catalog for #{node_name} from #{server} in environment #{environment}: #{e.message}"
122122
end

lib/puppet/face/catalog/diff.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
# User passed us two hostnames
213213
old_catalogs = Dir.mktmpdir("#{catalog1.tr('/', '_')}-")
214214
new_catalogs = Dir.mktmpdir("#{catalog2.tr('/', '_')}-")
215-
pull_output = Puppet::Face[:catalog, '0.0.1'].pull(
215+
@pull_output = Puppet::Face[:catalog, '0.0.1'].pull(
216216
old_catalogs, new_catalogs,
217217
options[:fact_search],
218218
old_server: catalog1, new_server: catalog2,
@@ -237,7 +237,7 @@
237237
nodes = diff_output
238238
FileUtils.rm_rf(old_catalogs)
239239
FileUtils.rm_rf(new_catalogs)
240-
nodes[:pull_output] = pull_output
240+
nodes[:pull_output] = @pull_output
241241
return nodes
242242
end
243243
raise 'No nodes were matched' if nodes.size.zero?
@@ -258,6 +258,7 @@
258258
nodes[:total_nodes] = total_nodes
259259
nodes[:date] = Time.new.iso8601
260260
nodes[:all_changed_nodes] = with_changes.keys
261+
nodes[:pull_output] = @pull_output unless @pull_output.nil?
261262

262263
if options[:output_report]
263264
Puppet.notice("Writing report to disk: #{options[:output_report]}")

0 commit comments

Comments
 (0)