From 11ae473e3852adcc382a3efea2329586d2e4bcb3 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 28 Nov 2007 15:20:52 -0600 Subject: Theoretically, this patch is to fix #917 (which it does), but there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class. --- lib/puppet/parser/ast/resource_defaults.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/puppet/parser/ast') diff --git a/lib/puppet/parser/ast/resource_defaults.rb b/lib/puppet/parser/ast/resource_defaults.rb index 44ec146b0..8f9c1b8df 100644 --- a/lib/puppet/parser/ast/resource_defaults.rb +++ b/lib/puppet/parser/ast/resource_defaults.rb @@ -10,7 +10,10 @@ class Puppet::Parser::AST # object type. def evaluate(hash) scope = hash[:scope] - type = @type.downcase + + # Use a resource reference to canonize the type + ref = Puppet::ResourceReference.new(@type, "whatever") + type = ref.type params = @params.safeevaluate(:scope => scope) parsewrap do -- cgit