diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-18 00:22:45 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-18 00:22:45 +0000 |
| commit | f1ebef038b12231e876510c7247a82f6367a8d45 (patch) | |
| tree | 88b5b0c1496f32a47eac7dadaff6fa0c5421811c /lib | |
| parent | 52105c61ac135cc197910fc3a6c32d43fa8ce6cd (diff) | |
| download | puppet-f1ebef038b12231e876510c7247a82f6367a8d45.tar.gz puppet-f1ebef038b12231e876510c7247a82f6367a8d45.tar.xz puppet-f1ebef038b12231e876510c7247a82f6367a8d45.zip | |
Fixing virtual object collection. I apparently broke it when I added rails collection back, and I never created any end-to-end tests.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1805 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/parser/ast/collection.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/parser/collector.rb | 11 | ||||
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/type/pfile/target.rb | 3 |
4 files changed, 13 insertions, 13 deletions
diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb index fa480b179..c817b5c5e 100644 --- a/lib/puppet/parser/ast/collection.rb +++ b/lib/puppet/parser/ast/collection.rb @@ -13,12 +13,12 @@ class Collection < AST::Branch scope = hash[:scope] if self.query - q = self.query.safeevaluate :scope => scope + str, code = self.query.safeevaluate :scope => scope else - q = nil + str = code = nil end - newcoll = Puppet::Parser::Collector.new(scope, @type, q, self.form) + newcoll = Puppet::Parser::Collector.new(scope, @type, str, code, self.form) scope.newcollection(newcoll) diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index f3c7949de..1fa314ae2 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -1,7 +1,7 @@ # An object that collects stored objects from the central cache and returns # them to the current host, yo. class Puppet::Parser::Collector - attr_accessor :type, :scope, :query, :form + attr_accessor :type, :scope, :vquery, :rquery, :form # Collect exported objects. def collect_exported @@ -75,10 +75,11 @@ class Puppet::Parser::Collector objects end - def initialize(scope, type, query, form) + def initialize(scope, type, equery, vquery, form) @scope = scope @type = type - @query = query + @equery = equery + @vquery = vquery @form = form @tests = [] end @@ -86,8 +87,8 @@ class Puppet::Parser::Collector # Does the resource match our tests? We don't yet support tests, # so it's always true at the moment. def match?(resource) - if self.query - return self.query.call(resource) + if self.vquery + return self.vquery.call(resource) else return true end diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 22017f8f8..8657ac0af 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -176,8 +176,10 @@ class Puppet::Parser::Interpreter failonleftovers(scope) # Now perform the collections - scope.collections.each do |coll| - coll.evaluate + exceptwrap do + scope.collections.each do |coll| + coll.evaluate + end end # Now finish everything. This recursively calls finish on the diff --git a/lib/puppet/type/pfile/target.rb b/lib/puppet/type/pfile/target.rb index 38151bfe0..8c22b10b9 100644 --- a/lib/puppet/type/pfile/target.rb +++ b/lib/puppet/type/pfile/target.rb @@ -59,9 +59,6 @@ module Puppet (tstat = File.lstat(should)) and (tstat.ftype == "directory") and @parent.recurse? - unless @parent.recurse? - raise "wtf?" - end warning "Changing ensure to directory; recurse is %s but %s" % [@parent[:recurse].inspect, @parent.recurse?] @parent[:ensure] = :directory |
