diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-13 02:14:35 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-13 02:14:35 +0000 |
commit | 0819e35be74bc997c3a953f05bab874b8d76429d (patch) | |
tree | a7abcf53ed750c8b530d7de88374a354f4b6bf2a /lib/puppet/parser/ast/hostclass.rb | |
parent | 678e14286f441524955c76fcfca6abace7106774 (diff) | |
download | puppet-0819e35be74bc997c3a953f05bab874b8d76429d.tar.gz puppet-0819e35be74bc997c3a953f05bab874b8d76429d.tar.xz puppet-0819e35be74bc997c3a953f05bab874b8d76429d.zip |
Adding some small changes towards fixing #140 and #83, but this work needs to take a back seat to object collection, so i will come back to it later.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1186 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/ast/hostclass.rb')
-rw-r--r-- | lib/puppet/parser/ast/hostclass.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/puppet/parser/ast/hostclass.rb b/lib/puppet/parser/ast/hostclass.rb index 85beecfe7..7f381db2a 100644 --- a/lib/puppet/parser/ast/hostclass.rb +++ b/lib/puppet/parser/ast/hostclass.rb @@ -14,8 +14,15 @@ class Puppet::Parser::AST # Verify that we haven't already been evaluated # FIXME The second subclass won't evaluate the parent class # code at all, and any overrides will throw an error. - if scope.lookupclass(self.object_id) + if myscope = scope.lookupclass(self.object_id) Puppet.debug "%s class already evaluated" % @type + + # Not used, but will eventually be used to fix #140. + if myscope.is_a? Puppet::Parser::Scope + unless scope.object_id == myscope.object_id + #scope.parent = myscope + end + end return nil end @@ -55,9 +62,14 @@ class Puppet::Parser::AST :type => @type, :name => objname, # might be nil :newcontext => newcontext, - :asparent => hash[:asparent] # might be nil + :asparent => hash[:asparent] || false # might be nil ) + # Now set the class again, this time using the scope. This way + # we can look up the parent scope of this class later, so we + # can hook the children together. + scope.setscope(self.object_id, result) + # This is important but painfully difficult. If we're the top-level # class, that is, we have no parent classes, then the transscope # is our own scope, but if there are parent classes, then the topmost |