summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-12-08 00:09:50 -0700
committerJames Turnbull <james@lovedthanlost.net>2008-12-08 19:44:29 +1100
commit68ffd46c9fd87e07d0171e7daa54b951f621c7b7 (patch)
treedc7b1cde4d3cb1468a655ec049b0152ebe17f7c9 /lib
parent7e2da7eeb25bb8879af40f12c4a04047a159374e (diff)
downloadpuppet-68ffd46c9fd87e07d0171e7daa54b951f621c7b7.tar.gz
puppet-68ffd46c9fd87e07d0171e7daa54b951f621c7b7.tar.xz
puppet-68ffd46c9fd87e07d0171e7daa54b951f621c7b7.zip
Bug #1803 Zfs should auto require the ancestor file systems
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/zfs.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/type/zfs.rb b/lib/puppet/type/zfs.rb
index d3af3a461..3a8806a5e 100755
--- a/lib/puppet/type/zfs.rb
+++ b/lib/puppet/type/zfs.rb
@@ -40,6 +40,12 @@ module Puppet
#strip the zpool off the zfs name and autorequire it
[@parameters[:name].value.split('/')[0]]
end
+
+ autorequire(:zfs) do
+ #slice and dice, we want all the zfs before this one
+ names = @parameters[:name].value.split('/')
+ names.slice(1..-2).inject([]) { |a,v| a << "#{a.last}/#{v}" }.collect { |fs| names[0] + fs }
+ end
end
end