Please review pull request #587: (#13204) Workaround duplicate Augeas save events opened by (domcleal)
Description:
Bug #264 in Augeas causes duplicate save events to be returned when editing
under /boot in newfile mode. Because we loop around these events, diffing and
unlinking the files, this causes an ENOENT error when we process the same event
twice.
This commit checks that the file we intend to operate on exists.
- Opened: Sun Mar 18 10:36:55 UTC 2012
- Based on: puppetlabs:2.7.x (75476e1ae2b3440af423d52869a9ff9e6a9637ea)
- Requested merge: domcleal:tickets/2.7.x/13204-aug-boot-enoent (f3a14fcc51794fae7c7680a7a9b349356e394713)
Diff follows:
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index 2ff8bd9..7681909 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -299,6 +299,7 @@ def need_to_run?
root = resource[:root].sub(/^\/$/, "")
saved_files.each do |key|
saved_file = @aug.get(key).sub(/^\/files/, root)
+ next unless File.exists?(saved_file + ".augnew")
if Puppet[:show_diff]
notice "\n" + diff(saved_file, saved_file + ".augnew")
end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.
