|
Lines 519-529
class base(object):
Link Here
|
| 519 |
def remove(self, remove_childs=0): |
519 |
def remove(self, remove_childs=0): |
| 520 |
'''remove object''' |
520 |
'''remove object''' |
| 521 |
|
521 |
|
| 522 |
# FIXME: the following check doesn't work anymore if we set _exists in open() |
522 |
if not self.dn or not self.lo.get(self.dn): |
| 523 |
# as an object naturally doesn't need to open to be removed; for now, let's |
523 |
raise univention.admin.uexceptions.noObject(self.dn) |
| 524 |
# see what happens without it |
|
|
| 525 |
#if not self.exists(): |
| 526 |
# raise univention.admin.uexceptions.noObject |
| 527 |
|
524 |
|
| 528 |
return self._remove(remove_childs) |
525 |
return self._remove(remove_childs) |
| 529 |
|
526 |
|
|
Lines 793-803
class simpleLdap(base):
Link Here
|
| 793 |
self._ldap_post_create() |
790 |
self._ldap_post_create() |
| 794 |
except Exception, e: |
791 |
except Exception, e: |
| 795 |
# ensure that there is no lock left |
792 |
# ensure that there is no lock left |
| 796 |
import sys, traceback |
793 |
import traceback |
| 797 |
univention.debug.debug( univention.debug.ADMIN, univention.debug.ERROR, "Post-modify operation failed: %s" % '\n'.join( traceback.format_tb( sys.exc_info()[ 2 ] ) ) ) |
794 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, "Post-modify operation failed: %s" % (traceback.format_exc(),)) |
| 798 |
self.cancel() |
795 |
try: |
| 799 |
self.remove() |
796 |
self.cancel() |
| 800 |
raise e |
797 |
self.remove() |
|
|
798 |
except: |
| 799 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, "Post-modify: Reverting failed: %s" % (traceback.format_exc(),)) |
| 800 |
raise |
| 801 |
|
801 |
|
| 802 |
self.call_udm_property_hook('hook_ldap_post_create', self) |
802 |
self.call_udm_property_hook('hook_ldap_post_create', self) |
| 803 |
|
803 |
|
|
Lines 1014-1021
class simpleLdap(base):
Link Here
|
| 1014 |
self.call_udm_property_hook('hook_ldap_pre_remove', self) |
1014 |
self.call_udm_property_hook('hook_ldap_pre_remove', self) |
| 1015 |
|
1015 |
|
| 1016 |
if remove_childs: |
1016 |
if remove_childs: |
| 1017 |
if not self.dn: |
|
|
| 1018 |
raise univention.admin.uexceptions.noObject |
| 1019 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO,'handlers/__init__._remove() childs of base dn %s' % self.dn) |
1017 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO,'handlers/__init__._remove() childs of base dn %s' % self.dn) |
| 1020 |
subelements = self.lo.search(base=self.dn, scope='one', attr=[]) |
1018 |
subelements = self.lo.search(base=self.dn, scope='one', attr=[]) |
| 1021 |
if subelements: |
1019 |
if subelements: |