module-common/lib/puppet/parser/functions/get_default.rb
2014-10-09 13:33:11 +02:00

15 lines
355 B
Ruby

# get_default($value, $default) : $value
#
# return $value || $default.
module Puppet::Parser::Functions
newfunction(:get_default, :type => :rvalue) do |args|
value = nil
args.each { |x|
if ! x.nil? and x.length > 0
value = x
break
end
}
return value
end
end