mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2025-09-07 13:59:28 +00:00
working prototype (config generation)
This commit is contained in:
15
lib/puppet/parser/functions/pick_undef.rb
Normal file
15
lib/puppet/parser/functions/pick_undef.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:pick_undef, :type => :rvalue, :doc => <<-EOS
|
||||
This function is similar to pick_default, but will return or undefined values.
|
||||
EOS
|
||||
) do |args|
|
||||
fail "Must receive at least one argument." if args.empty?
|
||||
default = args.last
|
||||
args = args[0..-2].compact
|
||||
# args.delete(:undef)
|
||||
# args.delete(:undefined)
|
||||
# args.delete("")
|
||||
args << default
|
||||
return args[0]
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user