module-puppetdb/lib/puppet/parser/functions/puppetdb_create_subsetting_resource_hash.rb
2013-04-12 15:24:52 +02:00

15 lines
No EOL
409 B
Ruby

module Puppet::Parser::Functions
newfunction(:puppetdb_create_subsetting_resource_hash, :type => :rvalue) do |args|
java_args = args[0]
params = args[1]
resource_hash = {}
java_args.each { |k,v|
item_params = { 'subsetting' => k, 'value' => (v || '') }
item_params.merge!(params)
resource_hash.merge!({ "'#{k}'" => item_params })
}
resource_hash
end
end