Univention Bugzilla – Attachment 8220 Details for
Bug 37584
use the 'matched' attribute of python-ldap exceptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
37584.patch (text/plain), 4.83 KB, created by
Florian Best
on 2016-11-14 18:36:45 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-11-14 18:36:45 CET
Size:
4.83 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admin/uldap.py b/management/univention-directory-manager-modules/modules/univention/admin/uldap.py >index 689d756..fd0f594 100644 >--- a/management/univention-directory-manager-modules/modules/univention/admin/uldap.py >+++ b/management/univention-directory-manager-modules/modules/univention/admin/uldap.py >@@ -85,7 +85,8 @@ def _err2str(err): > msgs = [] > for iarg in err.args: > if isinstance(iarg, dict): >- msg = ': '.join([str(m) for m in (iarg.get('desc'), iarg.get('info')) if m]) >+ matched = 'matched %s' % (iarg['matched'],) if 'matched' in iarg else '' >+ msg = ': '.join([str(m) for m in (iarg.get('desc'), iarg.get('info'), matched) if m]) > else: > msg = str(iarg) > if msg: >@@ -358,7 +359,7 @@ def search(self, filter='(objectClass=*)', base='', scope='sub', attr=[], unique > try: > return self.lo.search(filter, base, scope, attr, unique, required, timeout, sizelimit) > except ldap.NO_SUCH_OBJECT as msg: >- raise univention.admin.uexceptions.noObject(_err2str(msg)) >+ raise univention.admin.uexceptions.noObject(base, _err2str(msg)) > except ldap.INAPPROPRIATE_MATCHING as msg: > raise univention.admin.uexceptions.insufficientInformation(_err2str(msg)) > except (ldap.TIMEOUT, ldap.TIMELIMIT_EXCEEDED) as msg: >@@ -374,7 +375,7 @@ def searchDn(self, filter='(objectClass=*)', base='', scope='sub', unique=False, > try: > return self.lo.searchDn(filter, base, scope, unique, required, timeout, sizelimit) > except ldap.NO_SUCH_OBJECT as msg: >- raise univention.admin.uexceptions.noObject(_err2str(msg)) >+ raise univention.admin.uexceptions.noObject(base, _err2str(msg)) > except ldap.INAPPROPRIATE_MATCHING as msg: > raise univention.admin.uexceptions.insufficientInformation(_err2str(msg)) > except (ldap.TIMEOUT, ldap.TIMELIMIT_EXCEEDED) as msg: >@@ -407,6 +408,9 @@ def add(self, dn, al, exceptions=False): > except ldap.INSUFFICIENT_ACCESS as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg)) > raise univention.admin.uexceptions.permissionDenied >+ except ldap.NO_SUCH_OBJECT as msg: >+ univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg)) >+ raise univention.admin.uexceptions.noObject(dn, _err2str(msg)) > except ldap.LDAPError as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg)) > raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) >@@ -424,7 +428,7 @@ def modify(self, dn, changes, exceptions=False, ignore_license=0): > return self.lo.modify(dn, changes) > except ldap.NO_SUCH_OBJECT as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg)) >- raise univention.admin.uexceptions.noObject(dn) >+ raise univention.admin.uexceptions.noObject(dn, _err2str(msg)) > except ldap.INSUFFICIENT_ACCESS as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg)) > raise univention.admin.uexceptions.permissionDenied >@@ -433,8 +437,8 @@ def modify(self, dn, changes, exceptions=False, ignore_license=0): > raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) > > def rename(self, dn, newdn, move_childs=0, ignore_license=False): >- if not move_childs == 0: >- raise univention.admin.uexceptions.noObject(_("Moving children is not supported.")) >+ if move_childs: >+ raise univention.admin.uexceptions.noObject(dn, _("Moving children is not supported.")) > self._validateLicense() > if not self.allow_modify and not ignore_license: > univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'move dn: %s' % dn) >@@ -445,7 +449,7 @@ def rename(self, dn, newdn, move_childs=0, ignore_license=False): > return self.lo.rename(dn, newdn) > except ldap.NO_SUCH_OBJECT as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg)) >- raise univention.admin.uexceptions.noObject(dn) >+ raise univention.admin.uexceptions.noObject(dn, _err2str(msg)) > except ldap.INSUFFICIENT_ACCESS as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg)) > raise univention.admin.uexceptions.permissionDenied >@@ -465,7 +469,7 @@ def delete(self, dn, exceptions=False): > return self.lo.delete(dn) > except ldap.NO_SUCH_OBJECT as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg)) >- raise univention.admin.uexceptions.noObject(dn) >+ raise univention.admin.uexceptions.noObject(dn, _err2str(msg)) > except ldap.INSUFFICIENT_ACCESS as msg: > univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg)) > raise univention.admin.uexceptions.permissionDenied
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 37584
:
6622
|
6755
|
8220
|
10753