diff --git a/services/univention-s4-connector/modules/univention/s4connector/__init__.py b/services/univention-s4-connector/modules/univention/s4connector/__init__.py index 14e0ddd90c..a497aedc20 100644 --- a/services/univention-s4-connector/modules/univention/s4connector/__init__.py +++ b/services/univention-s4-connector/modules/univention/s4connector/__init__.py @@ -1434,9 +1434,11 @@ class ucs: key = k break back_mapped_subobject = self._object_mapping(key, subobject_ucs, 'ucs') + result_s4 = self.lo_s4.lo.search_ext_s(univention.s4connector.s4.compatible_modstring(back_mapped_subobject['dn']), ldap.SCOPE_BASE, '(objectClass=*)', timeout=-1, sizelimit=0) + subobject_s4 = {'dn': result_s4[0][0], 'modtype': 'delete', 'attributes': result_s4[0][1]} ud.debug(ud.LDAP, ud.WARN, "delete subobject: %s" % back_mapped_subobject['dn']) if not self._ignore_object(key, back_mapped_subobject): - if not self.sync_to_ucs(key, subobject_ucs, back_mapped_subobject['dn'], object): + if not self.sync_to_ucs(key, subobject_ucs, back_mapped_subobject['dn'], subobject_s4): try: ud.debug(ud.LDAP, ud.WARN, "delete of subobject failed: %s" % result[0]) except (ldap.SERVER_DOWN, SystemExit): @@ -1508,7 +1510,8 @@ class ucs: return False try: - guid_unicode = original_object.get('attributes').get('objectGUID')[0] + attributes = original_object.get('attributes') + guid_unicode = attributes.get('objectGUID')[0] guid_blob = guid_unicode.encode('ISO-8859-1') # to compensate for __object_from_element guid = str(ndr_unpack(misc.GUID, guid_blob))