equal
deleted
inserted
replaced
223 return eid |
223 return eid |
224 |
224 |
225 def object_exists_in_ldap(self, dn): |
225 def object_exists_in_ldap(self, dn): |
226 cnx = self.get_connection().cnx #session.cnxset.connection(self.uri).cnx |
226 cnx = self.get_connection().cnx #session.cnxset.connection(self.uri).cnx |
227 if cnx is None: |
227 if cnx is None: |
228 return True # ldap unreachable, suppose it exists |
228 self.warning('Could not establish connexion with LDAP server, assuming dn %s exists', dn) |
|
229 return True # ldap unreachable, let's not touch it |
229 try: |
230 try: |
230 cnx.search_s(dn, self.user_base_scope) |
231 cnx.search_s(dn, self.user_base_scope) |
231 except ldap.PARTIAL_RESULTS: |
232 except ldap.PARTIAL_RESULTS: |
232 pass |
233 self.warning('PARTIAL RESULTS for dn %s', dn) |
233 except ldap.NO_SUCH_OBJECT: |
234 except ldap.NO_SUCH_OBJECT: |
234 return False |
235 return False |
235 return True |
236 return True |
236 |
237 |
237 def _connect(self, user=None, userpwd=None): |
238 def _connect(self, user=None, userpwd=None): |