| Server IP : 77.68.64.21 / Your IP : 216.73.217.59 Web Server : Apache System : Linux hp3-wp-1011352.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64 User : csh2516497 ( 2094697) PHP Version : 8.3.30 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/ruby/vendor_ruby/puppet/parser/ast/ |
Upload File : |
require 'puppet'
require 'puppet/parser/ast/branch'
require 'puppet/parser/collector'
# An object that collects stored objects from the central cache and returns
# them to the current host, yo.
class Puppet::Parser::AST
class Collection < AST::Branch
attr_accessor :type, :query, :form
attr_reader :override
associates_doc
# We return an object that does a late-binding evaluation.
def evaluate(scope)
match, code = query && query.safeevaluate(scope)
resource_type = scope.find_resource_type(@type)
fail "Resource type #{@type} doesn't exist" unless resource_type
newcoll = Puppet::Parser::Collector.new(scope, resource_type.name, match, code, self.form)
scope.compiler.add_collection(newcoll)
# overrides if any
# Evaluate all of the specified params.
if @override
params = @override.collect { |param| param.safeevaluate(scope) }
newcoll.add_override(
:parameters => params,
:file => @file,
:line => @line,
:source => scope.source,
:scope => scope
)
end
newcoll
end
# Handle our parameter ourselves
def override=(override)
@override = if override.is_a?(AST::ASTArray)
override
else
AST::ASTArray.new(:line => override.line,:file => override.file,:children => [override])
end
end
end
end