summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource.rb
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-07-19 18:28:30 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-19 19:56:08 -0700
commit1288f8c4051105d6cfbf4f532d5e5e926613e9df (patch)
tree0a261524f25ddddbb63c6abd18b708a4d58baa00 /lib/puppet/resource.rb
parent539d71635132bd5f772a550b7bfff530e8b59b68 (diff)
downloadpuppet-1288f8c4051105d6cfbf4f532d5e5e926613e9df.tar.gz
puppet-1288f8c4051105d6cfbf4f532d5e5e926613e9df.tar.xz
puppet-1288f8c4051105d6cfbf4f532d5e5e926613e9df.zip
[#4270] Force inherited classes to load into the correct environment
Parent classes were getting searched for in a way that fails if they were not already loaded into an environment. This patch replaces that codepath with a call that will load them if they are needed. This bug was masked by another bug that loads all classes into "production", whether they are used there or not.
Diffstat (limited to 'lib/puppet/resource.rb')
-rw-r--r--lib/puppet/resource.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index ca7c212a9..96d22e414 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -357,7 +357,8 @@ class Puppet::Resource
def find_resource_type(type)
# It still works fine without the type == 'class' short-cut, but it is a lot slower.
- find_builtin_resource_type(type) || find_defined_resource_type(type) unless type.to_s.downcase == 'class'
+ return nil if ["class", "node"].include? type.to_s.downcase
+ find_builtin_resource_type(type) || find_defined_resource_type(type)
end
def find_builtin_resource_type(type)