[lc_ldap] Tests d'unicités avant de ressuciter, à affiner.
This commit is contained in:
parent
68ba8ebd9f
commit
0fb3c19242
1 changed files with 9 additions and 0 deletions
|
@ -176,6 +176,15 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
||||||
except ldap.NO_SUCH_OBJECT:
|
except ldap.NO_SUCH_OBJECT:
|
||||||
pass
|
pass
|
||||||
obj = new_cransldapobject(self, dn, mode='rw', ldif=ldif)
|
obj = new_cransldapobject(self, dn, mode='rw', ldif=ldif)
|
||||||
|
# On vérifie que les attibuts uniques que l'on veut réssuciter
|
||||||
|
# ne sont pas déjà dans ldap.
|
||||||
|
### TODO
|
||||||
|
### S'il existent déjà, traiter au cas par cas,
|
||||||
|
### par exemple, remettre l'ip/rid en automatique
|
||||||
|
for attr in obj.attrs.keys():
|
||||||
|
for attribut in obj[attr]:
|
||||||
|
attribut.check_uniqueness()
|
||||||
|
|
||||||
obj.history_add(login, u"resurrection")
|
obj.history_add(login, u"resurrection")
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue