Revision ee1f56de
Added by Marek Hulán over 9 years ago
lib/net/validations.rb | ||
---|---|---|
m.split("-").map { |nibble| "%02x" % ("0x" + nibble) }.join(":")
|
||
when /\A([a-f0-9]{1,2}-){5}[a-f0-9]{1,2}\z/
|
||
m.split("-").map { |nibble| "%02x" % ("0x" + nibble) }.join(":")
|
||
else
|
||
raise ArgumentError, "'#{mac}' is not a valid MAC address"
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
Fixes #9044 - fixes invalid mac in tests
Also do not reset invalid mac address to nil so we can propagate proper
validation error.