Univention Bugzilla – Attachment 7668 Details for
Bug 41294
cancel() not called when creating object fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
41294.patch (text/plain), 2.45 KB, created by
Florian Best
on 2016-05-18 18:54:15 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-05-18 18:54:15 CEST
Size:
2.45 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py b/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >index 9a2ed9e..b78af2c 100644 >--- a/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >+++ b/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >@@ -33,9 +33,11 @@ > import copy > import types > import re >+import sys > import time > import ldap > import ipaddr >+import traceback > > import univention.debug > >@@ -795,26 +797,27 @@ def _create(self): > al.append( ( 'objectClass', [ 'univentionObject', ] ) ) > al.append( ( 'univentionObjectType', [ self.module, ] ) ) > >- self.lo.add(self.dn, al) >- >- if hasattr(self,'_ldap_post_create'): >- # if anything goes wrong we need to remove the already created object, otherwise we run into 'already exists' errors >- try: >+ # if anything goes wrong we need to remove the already created object, otherwise we run into 'already exists' errors >+ try: >+ added = False >+ self.lo.add(self.dn, al) >+ added = True >+ if hasattr(self,'_ldap_post_create'): > self._ldap_post_create() >+ except: >+ # ensure that there is no lock left >+ exc = sys.exc_info() >+ univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "Create operation failed: %s" % (traceback.format_exc(),)) >+ try: >+ self.cancel() > except: >- # ensure that there is no lock left >- import traceback, sys >- exc = sys.exc_info() >- univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "Post-Create operation failed: %s" % (traceback.format_exc(),)) >- try: >- self.cancel() >- except: >- univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "Post-create: cancel() failed: %s" % (traceback.format_exc(),)) >- try: >+ univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "create: cancel() failed: %s" % (traceback.format_exc(),)) >+ try: >+ if added: > self.remove() >- except: >- univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "Post-create: remove() failed: %s" % (traceback.format_exc(),)) >- raise exc[0], exc[1], exc[2] >+ except: >+ univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "create: remove() failed: %s" % (traceback.format_exc(),)) >+ raise exc[0], exc[1], exc[2] > > self.call_udm_property_hook('hook_ldap_post_create', self) >
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 41294
:
7668
|
7778