module-common/lib/puppet/parser/functions/get_default.rb

16 lines
355 B
Ruby
Raw Normal View History

2014-10-09 13:32:52 +02:00
# 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