diff options
author | James Turnbull <james@lovedthanlost.net> | 2011-11-26 00:51:03 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2011-11-26 00:51:03 -0800 |
commit | b4d763cef69e94301351c7eeef5b22c75c8bc6dd (patch) | |
tree | be964d8d5d833b5b470e59a18e6c930f1c417b0a /lib | |
parent | 6fb7998cde3ddfa6961beda5aef4caa4617daf44 (diff) | |
parent | 5866bba816e54b6ed50f2827ffb2bfa4a951f93d (diff) | |
download | puppet-vcsrepo-b4d763cef69e94301351c7eeef5b22c75c8bc6dd.tar.gz puppet-vcsrepo-b4d763cef69e94301351c7eeef5b22c75c8bc6dd.tar.bz2 |
Merge pull request #13 from webfactory/cvs_module_name
Suggested fix for (#10751) by adding a "module" parameter
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/cvs.rb | 6 | ||||
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/cvs.rb b/lib/puppet/provider/vcsrepo/cvs.rb index d0ee773..f504cb1 100644 --- a/lib/puppet/provider/vcsrepo/cvs.rb +++ b/lib/puppet/provider/vcsrepo/cvs.rb @@ -5,7 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo) optional_commands :cvs => 'cvs' defaultfor :cvs => :exists - has_features :gzip_compression, :reference_tracking + has_features :gzip_compression, :reference_tracking, :modules def create if !@resource.value(:source) @@ -72,7 +72,9 @@ Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo) # When the source: # * Starts with ':' (eg, :pserver:...) def module_name - if (source = @resource.value(:source)) + if (m = @resource.value(:module)) + m + elsif (source = @resource.value(:source)) source[0, 1] == ':' ? File.basename(source) : '.' end end diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index 9bf8311..655549a 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -22,6 +22,9 @@ Puppet::Type.newtype(:vcsrepo) do feature :ssh_identity, "The provider supports a configurable SSH identity file" + feature :modules, + "The repository contains modules that can be chosen of" + ensurable do attr_accessor :latest @@ -148,4 +151,8 @@ Puppet::Type.newtype(:vcsrepo) do newparam :identity, :required_features => [:ssh_identity] do desc "SSH identity file" end + + newparam :module, :required_features => [:modules] do + desc "The repository module to manage" + end end |