summaryrefslogtreecommitdiff
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-07-29 17:55:45 +0100
committerKen Barber <ken@bob.sh>2011-07-29 17:55:45 +0100
commit4080c0534e76cf68b935344c75b2382f0184a226 (patch)
treeddf74ba1f46b5f8f28f56d3a10c0342e48ecebb4 /lib/puppet/parser
parentce48eb6e7a76f74e1f61c76ac3b185031c40772b (diff)
downloadpuppet-stdlib-4080c0534e76cf68b935344c75b2382f0184a226.tar.gz
puppet-stdlib-4080c0534e76cf68b935344c75b2382f0184a226.tar.bz2
(#2) unstub is_valid_mac_address.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/functions/is_valid_mac_address.rb8
1 files changed, 8 insertions, 0 deletions
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