summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-01 00:08:05 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-01 00:08:05 +0000
commit54a838e68e52b2eac353d70cb9281ca75d741839 (patch)
tree371e7fb59d2b7116b16984aa70187e646c1ecbc3 /lib
parentb8f798f0ad88c990b5f9fe4c2d7b830aeb36a446 (diff)
Fixing #369. I was not flushing changes to disk when ensure was out of sync. This is going to become a common problem, and should probably be addressed by the framework rather than by individual types, but for now, it works.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2008 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/mount.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 884b86c00..d9e894b05 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -14,6 +14,7 @@ module Puppet
newvalue(:present) do
if provider.mounted?
+ syncothers()
provider.unmount
return :mount_unmounted
else
@@ -36,9 +37,8 @@ module Puppet
if self.is == :absent or self.is.nil?
provider.create
end
- # We have to flush any changes to disk.
- @parent.flush
+ syncothers()
provider.mount
end
@@ -56,7 +56,20 @@ module Puppet
else
@is = super()
end
+ end
+ def syncothers
+ # We have to flush any changes to disk.
+ oos = @parent.send(:states).find_all do |st|
+ if st.name == :ensure
+ false
+ else
+ ! st.insync?
+ end
+ end.each { |st| st.sync }.length
+ if oos > 0
+ @parent.flush
+ end
end
end