diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-12 21:04:06 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-12 21:04:06 +0000 |
| commit | f420135270ab66c7bad10ebc4b031ddac3b57659 (patch) | |
| tree | 558fd25f3b4e9881c20a7123fbef5d5b715ca7ff /lib/puppet/parser | |
| parent | 8aa331d7b31033b1a7594a0020e8462f646241cf (diff) | |
| download | puppet-f420135270ab66c7bad10ebc4b031ddac3b57659.tar.gz puppet-f420135270ab66c7bad10ebc4b031ddac3b57659.tar.xz puppet-f420135270ab66c7bad10ebc4b031ddac3b57659.zip | |
Converting transport format to YAML instead of Marshal, and caching the file in a YAML format, also. This required a significant rework of both Transportable classes. Lastly, I am also now caching the list of classes in a class file in /etc/puppet.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@816 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 9 | ||||
| -rw-r--r-- | lib/puppet/parser/scope.rb | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 344863ec0..96555faa1 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -61,6 +61,9 @@ module Puppet # We've already evaluated the AST, in this case retval = @scope.evalnode(names, facts) + if classes = @scope.classlist + retval.classes = classes + end return retval else # We've already evaluated the AST, in this case @@ -68,7 +71,11 @@ module Puppet @scope.interp = self @scope.type = "puppet" @scope.name = "top" - return @scope.evaluate(@ast, facts, @classes) + retval = @scope.evaluate(@ast, facts, @classes) + if classes = @scope.classlist + retval.classes = classes + @classes + end + return retval end #@ast.evaluate(@scope) rescue Puppet::DevError, Puppet::Error, Puppet::ParseError => except diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index a2d05e7d4..598c67b5e 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -149,6 +149,14 @@ module Puppet @level == 1 end + # Return a list of all of the defined classes. + def classlist + unless defined? @classtable + raise Puppet::DevError, "Scope did not receive class table" + end + return @classtable.keys + end + # Yield each child scope in turn def each @children.reject { |child| @@ -714,7 +722,7 @@ module Puppet # it'd be nice not to have to do this... results.each { |result| - #Puppet.debug "Result type is %s" % result.class + #Puppet.warning "Result type is %s" % result.class bucket.push(result) } if defined? @type |
