[lc_ldap/attributs] ns1.crans.ens-cachan.fr n'était pas un nom d'hôte valide.

This commit is contained in:
Pierre-Elliott Bécue 2013-05-05 05:41:36 +02:00
parent 5942ee143c
commit a7d3af3ca1
2 changed files with 4 additions and 5 deletions

View file

@ -503,9 +503,8 @@ class dnsAttr(Attr):
category = 'dns'
def parse_value(self, val):
val = val.lower()
name, net = val.split('.', 1)
if (net not in ['adm.crans.org', 'crans.org', 'wifi.crans.org'] or
not re.match('[a-z][-_a-z0-9]+', name)):
name, _ = val.split('.', 1)
if not re.match('[a-z][-_a-z0-9]+', name):
raise ValueError("Nom d'hote invalide %r" % val)
self.value = val