diff --git a/attributs.py b/attributs.py index 5c1c4fb..3e2c439 100644 --- a/attributs.py +++ b/attributs.py @@ -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 diff --git a/lc_ldap.py b/lc_ldap.py index 3ecccf4..d2f7d90 100644 --- a/lc_ldap.py +++ b/lc_ldap.py @@ -252,7 +252,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object): uldif['ipsec'] = [u''.join( random.choice(filter(lambda x: x != 'l' and x != 'o', string.lowercase) + filter(lambda x: x != '1' and x != '0', string.digits)) for i in range(10))] assert isinstance(owner, adherent) or isinstance(owner, club) - elif realm in ["fil-adherents", "fil-v6", "personnel-ens"]: + elif realm in ["adherents", "fil-adherents", "fil-v6", "personnel-ens"]: uldif['objectClass'] = [u'machineFixe'] assert isinstance(owner, adherent) or isinstance(owner, club) @@ -824,7 +824,7 @@ class proprio(CransLdapObject): def machines(self): """Renvoie la liste des machines""" if not self._machines: - self._machines = self.conn.search('mid=*', dn = self.dn, scope = 1) + self._machines = self.conn.search('mid=*', dn = self.dn, scope = 1, mode=self.mode) for m in self._machines: m._proprio = self return self._machines