1 module Puppet::Parser::Functions
3 # given an array of network addresses, return only the ipv4 addresses
4 newfunction(:filter_ipv4, :type => :rvalue) do |args|
7 raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
8 return x.reject{ |x| x =~ /:/}
11 # given an array of network addresses, return only the ipv6 addresses
12 newfunction(:filter_ipv6, :type => :rvalue) do |args|
15 raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
16 return x.reject{ |x| x !~ /:/}
19 # given an list, join with spaces
20 newfunction(:join_spc, :type => :rvalue) do |args|
23 raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
29 # vim:set shiftwidth=2: