diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-21 19:28:01 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-21 19:28:01 -0500 |
| commit | b9dc6cb22f087f419b328cafa945c9604043b22f (patch) | |
| tree | ac7eabff6140018f860c85105941c564eb3dd5b2 /lib/puppet/util | |
| parent | 02275f0b29cee70e3f02d6d8f911eaaf3fad579d (diff) | |
It looks like the new indirection setup is complete.
I only need to port the node indirection termini over.
Diffstat (limited to 'lib/puppet/util')
| -rwxr-xr-x | lib/puppet/util/instance_loader.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/util/instance_loader.rb b/lib/puppet/util/instance_loader.rb index bc0567866..f280014eb 100755 --- a/lib/puppet/util/instance_loader.rb +++ b/lib/puppet/util/instance_loader.rb @@ -5,6 +5,12 @@ require 'puppet/util' # of Puppet::Util::Autoload module Puppet::Util::InstanceLoader include Puppet::Util + + # Are we instance-loading this type? + def instance_loading?(type) + defined?(@autoloaders) and @autoloaders.include?(symbolize(type)) + end + # Define a new type of autoloading. def instance_load(type, path, options = {}) @autoloaders ||= {} @@ -54,7 +60,7 @@ module Puppet::Util::InstanceLoader # Retrieve an alread-loaded instance, or attempt to load our instance. def loaded_instance(type, name) name = symbolize(name) - instances = instance_hash(type) + return nil unless instances = instance_hash(type) unless instances.include? name if instance_loader(type).load(name) unless instances.include? name |
