From 52e078444a12d47530a4299d0e9d60b86066c76e Mon Sep 17 00:00:00 2001 From: Bruce Williams Date: Sun, 14 Mar 2010 17:02:14 -0700 Subject: filesystem_type feature (for svn's --fstype) --- lib/puppet/provider/vcsrepo/svn.rb | 1 + lib/puppet/type/vcsrepo.rb | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 09fdd0e..7cdd157 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -7,6 +7,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) :svnadmin => 'svnadmin' defaultfor :svn => :exists + has_features :filesystem_types def create if !@resource.value(:source) diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index a722152..69c7f74 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -11,6 +11,8 @@ Puppet::Type.newtype(:vcsrepo) do and those with working copies", :methods => [:bare_exists?, :working_copy_exists?] + feature :filesystem_types, + "The provider supports different filesystem types" ensurable do @@ -62,8 +64,8 @@ Puppet::Type.newtype(:vcsrepo) do desc "The source URI for the repository" end - newparam(:fstype) do - desc "Filesystem type (for providers that support it, eg subversion)" + newparam(:fstype, :required_features => [:filesystem_types]) do + desc "Filesystem type" end newproperty(:revision) do @@ -72,7 +74,7 @@ Puppet::Type.newtype(:vcsrepo) do end newparam :compression, :required_features => [:gzip_compression] do - desc "Compression level (used by CVS)" + desc "Compression level" validate do |amount| unless Integer(amount).between?(0, 6) raise ArgumentError, "Unsupported compression level: #{amount} (expected 0-6)" -- cgit v1.2.3