diff options
| author | Paul Berry <paul@puppetlabs.com> | 2011-01-03 15:47:15 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2011-01-03 15:49:52 -0800 |
| commit | de85f8d598606fc4fcce59228f5cb6d2715e66b5 (patch) | |
| tree | 9f41bd49b277aee232bb7c4726a4234710fa82e1 /lib/puppet | |
| parent | e162da905549002d31eb9ff159406cec8b659046 (diff) | |
| download | puppet-de85f8d598606fc4fcce59228f5cb6d2715e66b5.tar.gz puppet-de85f8d598606fc4fcce59228f5cb6d2715e66b5.tar.xz puppet-de85f8d598606fc4fcce59228f5cb6d2715e66b5.zip | |
Prep work for #5758: set audited=true on all audit events
Previously, events would only have audited=true if auditing was
enabled AND there had been a change in an audited parameter.
Paired-with: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/transaction/resource_harness.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/puppet/transaction/resource_harness.rb b/lib/puppet/transaction/resource_harness.rb index cb9a193b9..c259d3e05 100644 --- a/lib/puppet/transaction/resource_harness.rb +++ b/lib/puppet/transaction/resource_harness.rb @@ -84,10 +84,12 @@ class Puppet::Transaction::ResourceHarness event.desired_value = property.should event.historical_value = historical_value - if do_audit and historical_value != current_value - event.message = "audit change: previously recorded value #{property.is_to_s(historical_value)} has been changed to #{property.is_to_s(current_value)}" - event.status = "audit" + if do_audit event.audited = true + event.status = "audit" + if historical_value != current_value + event.message = "audit change: previously recorded value #{property.is_to_s(historical_value)} has been changed to #{property.is_to_s(current_value)}" + end end event @@ -96,7 +98,7 @@ class Puppet::Transaction::ResourceHarness def apply_parameter(property, current_value, do_audit, historical_value) event = create_change_event(property, current_value, do_audit, historical_value) - if event.audited && historical_value + if do_audit && historical_value && historical_value != current_value brief_audit_message = " (previously recorded value was #{property.is_to_s(historical_value)})" else brief_audit_message = "" |
