diff options
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/ast/resource.rb | 3 | ||||
-rw-r--r-- | lib/puppet/parser/resource.rb | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/puppet/parser/ast/resource.rb b/lib/puppet/parser/ast/resource.rb index 5da40b32f..c82e0b525 100644 --- a/lib/puppet/parser/ast/resource.rb +++ b/lib/puppet/parser/ast/resource.rb @@ -44,7 +44,8 @@ class Resource < AST::ResourceReference :exported => self.exported, :virtual => virt, :source => scope.source, - :scope => scope + :scope => scope, + :strict => true ) # And then store the resource in the compiler. diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index 3f6d73df3..2d71079cc 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -110,9 +110,6 @@ class Puppet::Parser::Resource < Puppet::Resource def initialize(type, title, options) @scope = options[:scope] - self.relative_type = type - self.title = title - @params = {} # Define all of the parameters if params = options[:params] @@ -136,6 +133,13 @@ class Puppet::Parser::Resource < Puppet::Resource @source ||= scope.source + self.relative_type = type + self.title = title + + if strict? and ! resource_type + raise ArgumentError, "Invalid resource type #{type}" + end + tag(self.type) tag(self.title) if valid_tag?(self.title.to_s) end |