5 module Puppet::Parser::Functions
6 newfunction(:is_mac_address, :type => :rvalue, :doc => <<-EOS
7 Returns true if the string passed to this function is a valid mac address.
11 if (arguments.size != 1) then
12 raise(Puppet::ParseError, "is_mac_address(): Wrong number of arguments "+
13 "given #{arguments.size} for 1")
18 if /^[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}$/.match(mac) then
27 # vim: set ts=2 sw=2 et :