From 4080c0534e76cf68b935344c75b2382f0184a226 Mon Sep 17 00:00:00 2001 From: Ken Barber Date: Fri, 29 Jul 2011 17:55:45 +0100 Subject: (#2) unstub is_valid_mac_address. --- lib/puppet/parser/functions/is_valid_mac_address.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/functions/is_valid_mac_address.rb b/lib/puppet/parser/functions/is_valid_mac_address.rb index 0b91d0d..a00d874 100644 --- a/lib/puppet/parser/functions/is_valid_mac_address.rb +++ b/lib/puppet/parser/functions/is_valid_mac_address.rb @@ -12,6 +12,14 @@ module Puppet::Parser::Functions "given #{arguments.size} for 1") end + mac = arguments[0] + + 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 + return true + else + return false + end + end end -- cgit v1.2.3