diff --git a/lib/puppet/catalog-diff/compilecatalog.rb b/lib/puppet/catalog-diff/compilecatalog.rb index 7266b76..2751504 100644 --- a/lib/puppet/catalog-diff/compilecatalog.rb +++ b/lib/puppet/catalog-diff/compilecatalog.rb @@ -104,7 +104,7 @@ def compile_catalog(node_name, server, certless, tls_cert, tls_key, tls_ca) else Puppet.runtime[:http].get(uri, headers: headers, options: { ssl_context: ssl_context }) end - raise "HTTP request to Puppetserver #{server} failed with: HTTP #{ret.code} - #{ret.reason}" unless ret.success? + raise "HTTP request to Puppetserver #{server} failed with: HTTP #{ret.code} - #{ret.body}" unless ret.success? rescue Exception => e raise "Failed to retrieve catalog for #{node_name} from #{server} in environment #{environment}: #{e.message}" end diff --git a/lib/puppet/face/catalog/diff.rb b/lib/puppet/face/catalog/diff.rb index d25ab61..162d237 100644 --- a/lib/puppet/face/catalog/diff.rb +++ b/lib/puppet/face/catalog/diff.rb @@ -208,7 +208,7 @@ # User passed us two hostnames old_catalogs = Dir.mktmpdir("#{catalog1.tr('/', '_')}-") new_catalogs = Dir.mktmpdir("#{catalog2.tr('/', '_')}-") - pull_output = Puppet::Face[:catalog, '0.0.1'].pull( + @pull_output = Puppet::Face[:catalog, '0.0.1'].pull( old_catalogs, new_catalogs, options[:fact_search], old_server: catalog1, new_server: catalog2, @@ -232,7 +232,7 @@ nodes = diff_output FileUtils.rm_rf(old_catalogs) FileUtils.rm_rf(new_catalogs) - nodes[:pull_output] = pull_output + nodes[:pull_output] = @pull_output return nodes end raise 'No nodes were matched' if nodes.size.zero? @@ -253,6 +253,7 @@ nodes[:total_nodes] = total_nodes nodes[:date] = Time.new.iso8601 nodes[:all_changed_nodes] = with_changes.keys + nodes[:pull_output] = @pull_output unless @pull_output.nil? if options[:output_report] Puppet.notice("Writing report to disk: #{options[:output_report]}")