[attributs] parsing/typechecking pour tous less attributs
This commit is contained in:
parent
70a64f3003
commit
628c0f59bd
2 changed files with 97 additions and 27 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue