diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-03 18:20:04 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-03 18:20:04 -0500 |
| commit | 9d70b9746c09f648efd6a315b3ea088da38ecd1e (patch) | |
| tree | a8e7335d58008e1e24ed854703b1b9d54cc5a68d /lib/puppet | |
| parent | b021587e309f237bd16bd4f5cc51e79266cbd222 (diff) | |
| download | puppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.tar.gz puppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.tar.xz puppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.zip | |
Removing the Scope#setresource method, since it was essentially redundant. The work is done in either AST::ResourceDef#evaluate or Compile#store_resource.
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/parser/ast/resourcedef.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/parser/scope.rb | 15 |
2 files changed, 3 insertions, 18 deletions
diff --git a/lib/puppet/parser/ast/resourcedef.rb b/lib/puppet/parser/ast/resourcedef.rb index dfd7c447e..7a43f6b32 100644 --- a/lib/puppet/parser/ast/resourcedef.rb +++ b/lib/puppet/parser/ast/resourcedef.rb @@ -90,13 +90,13 @@ class ResourceDef < AST::Branch # many times. objtitles.collect { |objtitle| exceptwrap :type => Puppet::ParseError do - exp = self.exported || scope.exported + exp = self.exported || scope.exported? # We want virtual to be true if exported is true. We can't # just set :virtual => self.virtual in the initialization, # because sometimes the :virtual attribute is set *after* # :exported, in which case it clobbers :exported if :exported # is true. Argh, this was a very tough one to track down. - virt = self.virtual || exported + virt = self.virtual || scope.virtual? || exported obj = Puppet::Parser::Resource.new( :type => objtype, :title => objtitle, @@ -112,7 +112,7 @@ class ResourceDef < AST::Branch # And then store the resource in the scope. # XXX At some point, we need to switch all of this to return # objects instead of storing them like this. - scope.setresource(obj) + scope.compile.store_resource(scope, obj) obj end }.reject { |obj| obj.nil? } diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 396cce888..635a471df 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -255,21 +255,6 @@ class Puppet::Parser::Scope nil end - # Add a new object to our object table and the global list, and do any necessary - # checks. - def setresource(resource) - @compile.store_resource(self, resource) - - # Mark the resource as virtual or exported, as necessary. - if self.exported? - resource.exported = true - elsif self.virtual? - resource.virtual = true - end - - return resource - end - # Override a parameter in an existing object. If the object does not yet # exist, then cache the override in a global table, so it can be flushed # at the end. |
