diff --git b/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py a/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py index 1a78df5..8169f85 100644 --- b/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py +++ a/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py @@ -569,8 +569,7 @@ def __init__(self, co, lo, position, dn='', superordinate=None, attributes=None) try: self.oldattr = self.lo.get(self.dn, required=True) except ldap.NO_SUCH_OBJECT: - pass -# raise univention.admin.uexceptions.noObject(self.dn) + raise univention.admin.uexceptions.noObject(self.dn) if self.oldattr: self._exists = True diff --git a/base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py b/base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py index edb4e88..c5015f2 100644 --- a/base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py +++ b/base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py @@ -3,7 +3,7 @@ import univention.admin.objects import univention.admin.uldap as uldap import univention.admin.modules as modules -from univention.admin.uexceptions import base as UniventionBaseException +from univention.admin.uexceptions import base as UniventionBaseException, noObject from ldap import LDAPError @@ -66,8 +66,9 @@ def _remove_old_network(self): network_dn = "cn=default,cn=networks,%(ldap/base)s" % self.changeset.ucr network_module = modules.get("networks/network") modules.init(self.ldap, self.position, network_module) - network = univention.admin.objects.get(network_module, None, self.ldap, self.position, network_dn) - if not network.exists(): + try: + network = univention.admin.objects.get(network_module, None, self.ldap, self.position, network_dn) + except noObject: return self.logger.info("Removing '%s'...", network_dn) if not self.changeset.no_act: