Revision ee1f56de
Added by Marek Hulán over 9 years ago
app/models/host/managed.rb | ||
---|---|---|
end
|
||
|
||
def normalize_addresses
|
||
self.mac = Net::Validations.normalize_mac(mac)
|
||
begin
|
||
self.mac = Net::Validations.normalize_mac(mac)
|
||
rescue ArgumentError => e
|
||
self.errors.add(:mac, e.message)
|
||
end
|
||
self.ip = Net::Validations.normalize_ip(ip)
|
||
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.