From 72df8ecb489c13a0bf7bdb78455e6d523404dd8b Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Fri, 19 Oct 2012 01:25:19 -0700 Subject: Dummy provider raises an exception if it is used. Tests to prove it. --- lib/puppet/provider/vcsrepo/dummy.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3