summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/node.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-14 15:19:48 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-14 15:19:48 +0000
commit27cabf25fc08ee77df08ec65a440f9d164b9215d (patch)
tree558ae2a8d0709c75c53601afa1021125dc9d4950 /lib/puppet/parser/ast/node.rb
parent613c413cd84a690f1fb0cb625380e430bc502c84 (diff)
downloadpuppet-27cabf25fc08ee77df08ec65a440f9d164b9215d.tar.gz
puppet-27cabf25fc08ee77df08ec65a440f9d164b9215d.tar.xz
puppet-27cabf25fc08ee77df08ec65a440f9d164b9215d.zip
Fixing a weird bug that occurred because I was changing @parentclass in the AST stuff the first time it was called, from a string to a the actual instance of the parent. This worked fine as long as the parentclass was only called when parsing was complete, such as during evaluation, but if anything resulted in it being called earlier (e.g., attempting to add to the class during parsing), then things behaved, um, badly. This commit fixes the method so that the variable is not modified; there is now @parentclass and @parentobj.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2511 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast/node.rb')
-rw-r--r--lib/puppet/parser/ast/node.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/puppet/parser/ast/node.rb b/lib/puppet/parser/ast/node.rb
index 704710dc1..e873cac46 100644
--- a/lib/puppet/parser/ast/node.rb
+++ b/lib/puppet/parser/ast/node.rb
@@ -19,7 +19,7 @@ class Puppet::Parser::AST
# We don't have to worry about the declarativeness of node parentage,
# because the entry point is always a single node definition.
- if parent = self.parentclass
+ if parent = self.parentobj
scope = parent.safeevaluate :scope => scope
end
@@ -53,12 +53,10 @@ class Puppet::Parser::AST
end
end
- def parentclass
- parentobj do |name|
- @interp.nodesearch(name)
- end
-
- @parentclass
+ private
+ # Search for the object matching our parent class.
+ def find_parentclass
+ @interp.nodesearch(parentclass)
end
end
end