attributs: allow macAddress "<automatique>"
This commit is contained in:
parent
fefad357fc
commit
68587e3ebb
1 changed files with 10 additions and 6 deletions
14
attributs.py
14
attributs.py
|
@ -50,12 +50,10 @@ from unicodedata import normalize
|
|||
from crans_utils import format_tel, format_mac, mailexist, validate_name, ip4_of_rid, ip6_of_mac
|
||||
import itertools
|
||||
|
||||
sys.path.append("/usr/scripts/")
|
||||
sys.path.append("/usr/scripts")
|
||||
import cranslib.deprecated
|
||||
sys.path.append("/usr/scripts/gestion")
|
||||
import config
|
||||
import config.impression
|
||||
import annuaires_pg
|
||||
from gestion import config
|
||||
from gestion import annuaires_pg
|
||||
|
||||
#: Serveur SMTP
|
||||
smtpserv = "smtp.crans.org"
|
||||
|
@ -772,10 +770,16 @@ class macAddress(Attr):
|
|||
category = 'base_tech'
|
||||
can_modify = [parent, nounou, cableur]
|
||||
ldap_name = "macAddress"
|
||||
default = u'<automatique>'
|
||||
|
||||
def parse_value(self, mac):
|
||||
mac = mac.lower()
|
||||
if mac == macAddress.default:
|
||||
self.value = mac
|
||||
else:
|
||||
self.value = format_mac(mac)
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.value).lower()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue