diff options
author | Aaron Stone <aaron@serendipity.cx> | 2012-10-19 01:25:19 -0700 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2012-10-19 01:25:19 -0700 |
commit | 72df8ecb489c13a0bf7bdb78455e6d523404dd8b (patch) | |
tree | a679f32dcd76aaac2b3e37a7ff0fc4de0d593f93 /lib | |
parent | 821c66fe76056784f84376e5beb4d2de629998ed (diff) | |
download | puppet-vcsrepo-72df8ecb489c13a0bf7bdb78455e6d523404dd8b.tar.gz puppet-vcsrepo-72df8ecb489c13a0bf7bdb78455e6d523404dd8b.tar.bz2 |
Dummy provider raises an exception if it is used. Tests to prove it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/dummy.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/provider/vcsrepo/dummy.rb b/lib/puppet/provider/vcsrepo/dummy.rb index f76e090..f7b4e54 100644 --- a/lib/puppet/provider/vcsrepo/dummy.rb +++ b/lib/puppet/provider/vcsrepo/dummy.rb @@ -4,4 +4,9 @@ Puppet::Type.type(:vcsrepo).provide(:dummy, :parent => Puppet::Provider::Vcsrepo 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 |