[attributs] parsing/typechecking pour tous less attributs

This commit is contained in:
Antoine Durand-Gasselin 2010-10-17 14:18:12 +02:00
parent 70a64f3003
commit 628c0f59bd
2 changed files with 97 additions and 27 deletions

View file

@ -68,7 +68,7 @@ def format_mac(mac):
Transforme une adresse pour obtenir la forme xx:xx:xx:xx:xx:xx
Retourne la mac formatée.
"""
netaddr.EUI(mac, dialect='mac_unix')
mac = netaddr.EUI(mac, dialect='mac_unix')
if not mac:
raise ValueError(u"MAC nulle interdite\nIl doit être possible de modifier l'adresse de la carte.")
return mac