From c35d07b4183be141fa606de665c52740f5cc6510 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 4 Jun 2007 20:37:14 +0000 Subject: Significantly reworked the type => provider interface with respect to listing existing provider instances. The class method on both class heirarchies has been renamed to 'instances', to start. Providers are now expected to return provider instances, instead of creating resources, and the resource's 'instances' method is expected to find the matching resource, if any, and set the resource's provider appropriately. This *significantly* reduces the reliance on effectively global state (resource references in the resource classes). This global state will go away soon. Along with this change, the 'prefetch' class method on providers now accepts the list of resources for prefetching. This again reduces reliance on global state, and makes the execution path much easier to follow. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2551 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/network/handler/resource.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/network/handler') diff --git a/test/network/handler/resource.rb b/test/network/handler/resource.rb index 8d1fa1087..589d22d83 100755 --- a/test/network/handler/resource.rb +++ b/test/network/handler/resource.rb @@ -183,8 +183,8 @@ class TestResourceServer < Test::Unit::TestCase Puppet::Type.type(:schedule).mkdefaultschedules Puppet::Type.eachtype do |type| - unless type.respond_to? :list - Puppet.warning "%s does not respond to :list" % type.name + unless type.respond_to? :instances + Puppet.warning "%s does not respond to :instances" % type.name next end next unless type.name == :package @@ -212,7 +212,7 @@ class TestResourceServer < Test::Unit::TestCase count = 0 described = {} Puppet.info "listing again" - type.list.each do |obj| + type.instances.each do |obj| assert_instance_of(type, obj) break if count > 5 -- cgit