[lc_ldap/*] (more) pylint compliance
This commit is contained in:
parent
db8b27e6a5
commit
a36bafa021
3 changed files with 35 additions and 23 deletions
12
lc_ldap.py
12
lc_ldap.py
|
@ -151,7 +151,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
|||
|
||||
plage = config.NETs[realm]
|
||||
mid = uldif.setdefault('mid', [ unicode(self._find_id('mid', plage)) ])
|
||||
return self._create_entity('mid=%s,%s' % (aid[0], parent), uldif)
|
||||
return self._create_entity('mid=%s,%s' % (mid[0], parent), uldif)
|
||||
|
||||
def newAdherent(self, uldif):
|
||||
"""Crée un nouvel adhérent"""
|
||||
|
@ -171,7 +171,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
|||
'''Crée une nouvelle entité ldap en dn, avec attributs ldif:
|
||||
uniquement en unicode'''
|
||||
for attr, vals in uldif:
|
||||
nuldiff = self.normalize_and_validate(attr, vals)
|
||||
nuldif = self.normalize_and_validate(attr, vals)
|
||||
lock = CransLock(self)
|
||||
for item in ['aid', 'uid', 'chbre', 'mailAlias', 'canonicalAlias',
|
||||
'fid', 'cid', 'mid', 'macAddress', 'host', 'hostAlias' ]:
|
||||
|
@ -191,15 +191,15 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
|||
nonfree = [ int(r[1].get(attr)[0]) for r in res if r[1].get(attr) ]
|
||||
nonfree.sort()
|
||||
|
||||
for id in plage:
|
||||
if nonfree and nonfree[0] <= id:
|
||||
while nonfree and nonfree[0] <= id:
|
||||
for i in plage:
|
||||
if nonfree and nonfree[0] <= i:
|
||||
while nonfree and nonfree[0] <= i:
|
||||
nonfree = nonfree[1:]
|
||||
else:
|
||||
break
|
||||
else:
|
||||
raise EnvironmentError(u'Aucun %s libre dans la plage [%d, %d]' %
|
||||
(attr, plage[0], id))
|
||||
(attr, plage[0], i))
|
||||
return id
|
||||
|
||||
def _hist(self, msg):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue