Issue #4339 has been updated by Jacob Helwig.
Looks like my suspicions were correct. After looking at things with Nick
Lewis, we found that Mocha seems to have a problem with expecting a stubbed
method never. The following change makes things all hunky-dory:
diff --git i/lib/puppet/configurer.rb w/lib/puppet/configurer.rb
index de1c93b..560924e 100644
--- i/lib/puppet/configurer.rb
+++ w/lib/puppet/configurer.rb
@@ -172,8 +172,8 @@ class Puppet::Configurer
def send_report(report, trans)
report.finalize_report if trans
puts report.summary if Puppet[:summarize]
- save_last_run_summary(report)
if Puppet[:report]
+ save_last_run_summary(report)
report.save
end
rescue => detail
diff --git i/spec/unit/configurer_spec.rb w/spec/unit/configurer_spec.rb
index d690957..f6a7c03 100755
--- i/spec/unit/configurer_spec.rb
+++ w/spec/unit/configurer_spec.rb
@@ -226,10 +226,12 @@ describe Puppet::Configurer, "when executing a
catalog run" do
end
describe Puppet::Configurer, "when sending a report" do
+ include PuppetSpec::Files
+
before do
Puppet.settings.stubs(:use).returns(true)
@configurer = Puppet::Configurer.new
- @configurer.stubs(:save_last_run_summary)
+ Puppet[:lastrunfile] = tmpfile('last_run_file')
@report = Puppet::Transaction::Report.new("apply")
@trans = stub 'transaction'
However after some archaeology on the mailing list, it looks like the
implementation was correct, and it was the tests that were wrong. We'll fix up
the tests shortly.
----------------------------------------
Feature #4339: Record last run status on the node
https://projects.puppetlabs.com/issues/4339
Author: R.I. Pienaar
Status: Accepted
Priority: Normal
Assignee: Jacob Helwig
Category: reports
Target version: 2.6.x
Affected Puppet version: 2.6.0
Keywords: communitypatch
mcollective
Branch: https://github.com/masterzen/puppet/tree/feature/master/4339
It would be helpful for monitoring if the status of the last run from either a
daemonized puppetd or one from --test etc could be recorded in $vardir
somewhere.
The whole report would be too big to parse regularly from nagios so maybe a
smaller structured yaml file with the information that --summarize would show.
This way we could easily monitor the detailed status of our node runs in a way
that isnt very resource intensive or requiring extra tools like dashboards -
just generally tighter integration with our existing toolset.
Additionally it would be helpful if the reports could be written on the nodes
as well as to the network.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.