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