diff options
author | Gary Larizza <gary@puppetlabs.com> | 2012-10-30 17:40:13 -0700 |
---|---|---|
committer | Gary Larizza <gary@puppetlabs.com> | 2012-10-30 17:40:13 -0700 |
commit | 8b0df4beccdb62a87e82ba2f25b8060882c07b93 (patch) | |
tree | a699ee9774122c4912c686dc041707a063e69a6d /lib/puppet/provider | |
parent | 109d181b8ec6130151b2e8144cdaecf986a96075 (diff) | |
parent | b0f655163696aea40813db54fd830387bfc7e499 (diff) | |
download | puppet-vcsrepo-8b0df4beccdb62a87e82ba2f25b8060882c07b93.tar.gz puppet-vcsrepo-8b0df4beccdb62a87e82ba2f25b8060882c07b93.tar.bz2 |
Merge pull request #35 from sodabrew/dummy-provider
Add a dummy provider, remove 'defaultfor' from all other providers.
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r-- | lib/puppet/provider/vcsrepo/bzr.rb | 1 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/cvs.rb | 1 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/dummy.rb | 12 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 1 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/hg.rb | 1 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 1 |
6 files changed, 12 insertions, 5 deletions
diff --git a/lib/puppet/provider/vcsrepo/bzr.rb b/lib/puppet/provider/vcsrepo/bzr.rb index f9d58e2..6169929 100644 --- a/lib/puppet/provider/vcsrepo/bzr.rb +++ b/lib/puppet/provider/vcsrepo/bzr.rb @@ -4,7 +4,6 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo) desc "Supports Bazaar repositories" optional_commands :bzr => 'bzr' - defaultfor :bzr => :exists has_features :reference_tracking def create diff --git a/lib/puppet/provider/vcsrepo/cvs.rb b/lib/puppet/provider/vcsrepo/cvs.rb index 5cdcfb8..6dc7882 100644 --- a/lib/puppet/provider/vcsrepo/cvs.rb +++ b/lib/puppet/provider/vcsrepo/cvs.rb @@ -4,7 +4,6 @@ Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo) desc "Supports CVS repositories/workspaces" optional_commands :cvs => 'cvs' - defaultfor :cvs => :exists has_features :gzip_compression, :reference_tracking, :modules def create diff --git a/lib/puppet/provider/vcsrepo/dummy.rb b/lib/puppet/provider/vcsrepo/dummy.rb new file mode 100644 index 0000000..f7b4e54 --- /dev/null +++ b/lib/puppet/provider/vcsrepo/dummy.rb @@ -0,0 +1,12 @@ +require File.join(File.dirname(__FILE__), '..', 'vcsrepo') + +Puppet::Type.type(:vcsrepo).provide(:dummy, :parent => Puppet::Provider::Vcsrepo) do + desc "Dummy default provider" + + defaultfor :vcsrepo => :dummy + + def working_copy_exists? + providers = @resource.class.providers.map{|x| x.to_s}.sort.reject{|x| x == "dummy"}.join(", ") rescue "none" + raise("vcsrepo resource must have a provider, available: #{providers}") + end +end diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 95115c6..9254243 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -6,7 +6,6 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) ##TODO modify the commands below so that the su - is included optional_commands :git => 'git', :su => 'su' - defaultfor :git => :exists has_features :bare_repositories, :reference_tracking, :ssh_identity, :multiple_remotes, :user def create diff --git a/lib/puppet/provider/vcsrepo/hg.rb b/lib/puppet/provider/vcsrepo/hg.rb index 0be5e08..67a2a82 100644 --- a/lib/puppet/provider/vcsrepo/hg.rb +++ b/lib/puppet/provider/vcsrepo/hg.rb @@ -4,7 +4,6 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d desc "Supports Mercurial repositories" optional_commands :hg => 'hg' - defaultfor :hg => :exists has_features :reference_tracking def create diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 85c5089..b2a8880 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -6,7 +6,6 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) optional_commands :svn => 'svn', :svnadmin => 'svnadmin' - defaultfor :svn => :exists has_features :filesystem_types, :reference_tracking, :basic_auth def create |