summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-01-05 17:22:30 -0800
committerNick Lewis <nick@puppetlabs.com>2011-01-06 15:19:42 -0800
commitb16e10dba6606b808ef195f4b57f2e8c66cf65ab (patch)
treebdacf054c1e877166217336322050ee03f28d607 /lib/puppet/application
parentfb8509acbd947712cac094a49227d28a16a366aa (diff)
parent19eb1e78e115d10bfb822e510213e4fab9cd2599 (diff)
downloadpuppet-b16e10dba6606b808ef195f4b57f2e8c66cf65ab.tar.gz
puppet-b16e10dba6606b808ef195f4b57f2e8c66cf65ab.tar.xz
puppet-b16e10dba6606b808ef195f4b57f2e8c66cf65ab.zip
Merge branch '2.6.x' into next
Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
Diffstat (limited to 'lib/puppet/application')
-rw-r--r--lib/puppet/application/inspect.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/puppet/application/inspect.rb b/lib/puppet/application/inspect.rb
index c76f9e4da..8c3a0011f 100644
--- a/lib/puppet/application/inspect.rb
+++ b/lib/puppet/application/inspect.rb
@@ -49,10 +49,10 @@ class Puppet::Application::Inspect < Puppet::Application
raise "Could not find catalog for #{Puppet[:certname]}"
end
- retrieval_time = Time.now - retrieval_starttime
- @report.add_times("config_retrieval", retrieval_time)
+ @report.configuration_version = catalog.version
- starttime = Time.now
+ inspect_starttime = Time.now
+ @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime)
catalog.to_ral.resources.each do |ral_resource|
audited_attributes = ral_resource[:audit]
@@ -62,13 +62,19 @@ class Puppet::Application::Inspect < Puppet::Application
status = Puppet::Resource::Status.new(ral_resource)
audited_attributes.each do |name|
- event = ral_resource.event(:previous_value => audited_resource[name], :property => name, :status => "audit", :message => "inspected value is #{audited_resource[name].inspect}")
- status.add_event(event)
+ next if audited_resource[name].nil?
+ # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW
+ if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent
+ event = ral_resource.event(:previous_value => audited_resource[name], :property => name, :status => "audit", :message => "inspected value is #{audited_resource[name].inspect}")
+ status.add_event(event)
+ end
end
@report.add_resource_status(status)
end
- @report.add_metric(:time, {"config_retrieval" => retrieval_time, "inspect" => Time.now - starttime})
+ finishtime = Time.now
+ @report.add_times("inspect", finishtime - inspect_starttime)
+ @report.finalize_report
begin
Puppet::Transaction::Report.indirection.save(@report)