diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-08 16:31:03 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-08 16:31:03 -0600 |
| commit | 964aebb96416984815f5ef74e36825915d52fe2a (patch) | |
| tree | 725253feb7f52442833d35545bf3630a322a66c0 /lib | |
| parent | 8f04446c9473cf80328dd9cbc9a1d15b6057409a (diff) | |
| parent | 22b96e0a8ab07ef3fddea3d3602948dbf45c4dd7 (diff) | |
| download | puppet-964aebb96416984815f5ef74e36825915d52fe2a.tar.gz puppet-964aebb96416984815f5ef74e36825915d52fe2a.tar.xz puppet-964aebb96416984815f5ef74e36825915d52fe2a.zip | |
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/parser/collector.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/parser/compile.rb | 10 | ||||
| -rw-r--r-- | lib/puppet/parser/functions.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/type/pfile/target.rb | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index 3eb37dfa2..e3c91bccb 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -23,7 +23,8 @@ class Puppet::Parser::Collector host = Puppet::Rails::Host.find_by_name(@scope.host) args = {:include => {:param_values => :param_name}} - args[:conditions] = "(exported = 't' AND restype = '%s')" % [@type] + args[:conditions] = "(exported = %s AND restype = '%s')" % + [ActiveRecord::Base.connection.quote(true), @type] if @equery args[:conditions] += " AND (%s)" % [@equery] end diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb index 992b165e5..f23b42a35 100644 --- a/lib/puppet/parser/compile.rb +++ b/lib/puppet/parser/compile.rb @@ -83,12 +83,12 @@ class Puppet::Parser::Compile return @configuration end - # FIXME There are no tests for this. + # LAK:FIXME There are no tests for this. def delete_collection(coll) @collections.delete(coll) if @collections.include?(coll) end - # FIXME There are no tests for this. + # LAK:FIXME There are no tests for this. def delete_resource(resource) @resource_table.delete(resource.ref) if @resource_table.include?(resource.ref) end @@ -114,7 +114,7 @@ class Puppet::Parser::Compile # find, just tag the configuration and move on. This method really just # creates resource objects that point back to the classes, and then the # resources are themselves evaluated later in the process. - def evaluate_classes(classes, scope) + def evaluate_classes(classes, scope, lazy_evaluate = true) unless scope.source raise Puppet::DevError, "No source for scope passed to evaluate_classes" end @@ -126,6 +126,10 @@ class Puppet::Parser::Compile # of resources. resource = Puppet::Parser::Resource.new(:type => "class", :title => klass.classname, :scope => scope, :source => scope.source) store_resource(scope, resource) + + # If they've disabled lazy evaluation (which the :include function does), + # then evaluate our resource immediately. + resource.evaluate unless lazy_evaluate @configuration.tag(klass.classname) found << name else diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index 1d07122d4..a0e8da86f 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -109,7 +109,9 @@ module Functions # Include the specified classes newfunction(:include, :doc => "Evaluate one or more classes.") do |vals| vals = [vals] unless vals.is_a?(Array) - klasses = compile.evaluate_classes(vals, self) + + # The 'false' disables lazy evaluation. + klasses = compile.evaluate_classes(vals, self, false) missing = vals.find_all do |klass| ! klasses.include?(klass) diff --git a/lib/puppet/type/pfile/target.rb b/lib/puppet/type/pfile/target.rb index b4a6481e0..a0e5dc401 100644 --- a/lib/puppet/type/pfile/target.rb +++ b/lib/puppet/type/pfile/target.rb @@ -45,6 +45,8 @@ module Puppet end end + @resource.send(:property_fix) + :link_created end end |
