puppet-pacemaker/lib/puppet/parser/functions/pacemaker_resource_parameters.rb
Dmitry Ilyin 475b7ebcd0 Pacemaker misc fixes
Add missing package, add mising parameters,
fix functions.

Change-Id: Ib885af7df8fc2b678272fe85e5d8bbdd9aa1988b
2016-05-31 11:58:45 +03:00

26 lines
567 B
Ruby

module Puppet::Parser::Functions
newfunction(
:pacemaker_resource_parameters,
type: :rvalue,
arity: -1,
doc: <<-eof
Gather resource parameters and their values
eof
) do |args|
parameters = {}
args.flatten.each_slice(2) do |key, value|
if value.nil? and key.is_a? Hash
parameters.merge! key
else
next if key.nil?
next if value.nil?
next if value == ''
next if value == :undef
key = key.to_s
parameters.store key, value
end
end
parameters
end
end