diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-26 17:01:46 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-26 17:01:46 +0000 |
commit | bda8e52a02d77c39cd96ea02352c0067a57135e7 (patch) | |
tree | 0df220bd8c0d3cb6af86ba328eff14507ffffe38 /lib/puppet/parser/ast/node.rb | |
parent | bff94634075617339f65be15dc7eb3261db48f85 (diff) | |
download | puppet-bda8e52a02d77c39cd96ea02352c0067a57135e7.tar.gz puppet-bda8e52a02d77c39cd96ea02352c0067a57135e7.tar.xz puppet-bda8e52a02d77c39cd96ea02352c0067a57135e7.zip |
This should have been in 0.16.1. Moving the "setclass" statements around so that classes are set before a given class's code is evaluated, so it can be tested within the code, within node defs, components, or classes.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1139 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast/node.rb')
-rw-r--r-- | lib/puppet/parser/ast/node.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/puppet/parser/ast/node.rb b/lib/puppet/parser/ast/node.rb index 2a8e6a85b..f1b128ccf 100644 --- a/lib/puppet/parser/ast/node.rb +++ b/lib/puppet/parser/ast/node.rb @@ -36,13 +36,14 @@ class Puppet::Parser::AST # already been defined at this top-level scope. #super(scope, facts, @name, @name) - # And then evaluate our code. - @code.safeevaluate(:scope => scope) - # Mark our node name as a class, too, but strip it of the domain - # name. + # name. Make the mark before we evaluate the code, so that it is + # marked within the code itself. scope.setclass(self.object_id, @type.sub(/\..+/, '')) + # And then evaluate our code. + @code.safeevaluate(:scope => scope) + return scope end |