lib/puppet/parser/compiler.rb
# Evaluate each specified class in turn.  If there are any classes we can't
# find, raise an error.  This method really just creates resource objects
# that point back to the classes, and then the resources are themselves
# evaluated later in the process.
#
# Sometimes we evaluate classes with a fully qualified name already, in which
# case, we tell scope.find_hostclass we've pre-qualified the name so it
# doesn't need to search its namespaces again.  This gets around a weird
# edge case of duplicate class names, one at top scope and one nested in our
# namespace and the wrong one (or both!) getting selected. See ticket #13349
# for more detail.  --jeffweiss 26 apr 2012
Evaluate each specified class in turn.  If there are any classes we can't
find, raise an error.  This method really just creates resource objects
that point back to the classes, and then the resources are themselves
evaluated later in the process.

Sometimes we evaluate classes with a fully qualified name already, in which
case, we tell scope.find_hostclass we've pre-qualified the name so it
doesn't need to search its namespaces again.  This gets around a weird
edge case of duplicate class names, one at top scope and one nested in our
namespace and the wrong one (or both!) getting selected. See ticket #13349
for more detail.
Evaluate each specified class in turn . If there are any classes we can ' t find raise an error . This method really just creates resource objects that point back to the classes and then the resources are themselves evaluated later in the process . Sometimes we evaluate classes with a fully qualified name already in which case we tell scope . find_hostclass we ' ve pre - qualified the name so it doesn ' t need to search its namespaces again . This gets around a weird edge case of duplicate class names one at top scope and one nested in our namespace and the wrong one ( or both! ) getting selected . See ticket #13349 for more detail .
def evaluate_classes(classes, scope, lazy_evaluate = true, fqname = false)
    raise Puppet::DevError, "No source for scope passed to evaluate_classes" unless scope.source
    class_parameters = nil
    if classes.class == Hash
      class_parameters = classes
      classes = classes.keys
    end
    classes.each do |name|
      if klass = scope.find_hostclass(name, :assume_fqname => fqname)
        if class_parameters
          resource = klass.ensure_in_catalog(scope, class_parameters[name] || {})
        else
          next if scope.class_scope(klass)
          resource = klass.ensure_in_catalog(scope)
        end
        resource.evaluate unless lazy_evaluate
      else
        raise Puppet::Error, "Could not find class #{name} for #{node.name}"
      end
    end
  end
def evaluate_classes ( classes , scope , lazy_evaluate = true , fqname = false ) raise Puppet :: DevError , "No source for scope passed to evaluate_classes" unless scope . source class_parameters = nil if classes . class == Hash class_parameters = classes classes = classes . keys end classes . each do | name | if klass = scope . find_hostclass ( name , :assume_fqname => fqname ) if class_parameters resource = klass . ensure_in_catalog ( scope , class_parameters [ name ] || { } ) else next if scope . class_scope ( klass ) resource = klass . ensure_in_catalog ( scope ) end resource . evaluate unless lazy_evaluate else raise Puppet :: Error , "Could not find class #{name} for #{node.name}" end end end
Evaluate each specified class in turn.
Evaluate each specified class in turn .
# if we are a param class, save the classes hash # and transform classes to be the keys # If we can find the class, then make a resource that will evaluate it. # If parameters are passed, then attempt to create a duplicate resource # so the appropriate error is thrown. # If they've disabled lazy evaluation (which the :include function does), # then evaluate our resource immediately.
classes
<not_specific>
scope
<not_specific>
lazy_evaluate
<not_specific>
fqname
<not_specific>