View | Details | Raw Unified | Return to bug 44770 | Differences between
and this patch

Collapse All | Expand All

(-)modules/univention/s4connector/__init__.py (-3 / +39 lines)
 Lines 1268-1274    Link Here 
1268
1256
1269
	def modify_in_ucs(self, property_type, object, module, position):
1257
	def modify_in_ucs(self, property_type, object, module, position):
1270
		_d = ud.function('ldap.modify_in_ucs')
1258
		_d = ud.function('ldap.modify_in_ucs')
1271
		module = self.modules[property_type]
1272
1259
1273
		if 'olddn' in object:
1260
		if 'olddn' in object:
1274
			dntype = 'olddn'
1261
			dntype = 'olddn'
 Lines 1276-1281    Link Here 
1276
			dntype = 'dn'
1263
			dntype = 'dn'
1277
1264
1278
		ucs_object_dn = object[dntype]
1265
		ucs_object_dn = object[dntype]
1266
1267
		if self.modules_others[property_type]:
1268
			ldap_object_ucs = self.get_ucs_ldap_object(ucs_object_dn)
1269
			if not module.identify(ucs_object_dn, ldap_object_ucs):
1270
				for m in self.modules_others[property_type]:
1271
					if m and m.identify(ucs_object_dn, ldap_object_ucs):
1272
						module = m
1273
						ud.debug(ud.LDAP, ud.INFO, "Mapping to other module: %r" % (module,))
1274
						break
1275
				else:
1276
					ud.debug(ud.LDAP, ud.ERROR, "Could not identify UDM module for: %s dn: %s" % (property_type, ucs_object_dn))
1277
					return False
1278
1279
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=ucs_object_dn, position='')
1279
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=ucs_object_dn, position='')
1280
		self.__set_values(property_type, object, ucs_object)
1280
		self.__set_values(property_type, object, ucs_object)
1281
		return ucs_object.modify() and self.__modify_custom_attributes(property_type, object, ucs_object, module, position)
1281
		return ucs_object.modify() and self.__modify_custom_attributes(property_type, object, ucs_object, module, position)
 Lines 1282-1288    Link Here 
1282
1282
1283
	def move_in_ucs(self, property_type, object, module, position):
1283
	def move_in_ucs(self, property_type, object, module, position):
1284
		_d = ud.function('ldap.move_in_ucs')
1284
		_d = ud.function('ldap.move_in_ucs')
1285
		module = self.modules[property_type]
1286
		try:
1285
		try:
1287
			if object['olddn'].lower() == object['dn'].lower():
1286
			if object['olddn'].lower() == object['dn'].lower():
1288
				ud.debug(ud.LDAP, ud.WARN, "move_in_ucs: cancel move, old and new dn are the same ( %s to %s)" % (object['olddn'], object['dn']))
1287
				ud.debug(ud.LDAP, ud.WARN, "move_in_ucs: cancel move, old and new dn are the same ( %s to %s)" % (object['olddn'], object['dn']))
 Lines 1294-1299    Link Here 
1294
		except:  # FIXME: which exception is to be caught?
1293
		except:  # FIXME: which exception is to be caught?
1295
			ud.debug(ud.LDAP, ud.INFO, "move_in_ucs: move object in UCS")
1294
			ud.debug(ud.LDAP, ud.INFO, "move_in_ucs: move object in UCS")
1296
1295
1296
		if self.modules_others[property_type]:
1297
			ucs_object_dn = object['dn']
1298
			ldap_object_ucs = self.get_ucs_ldap_object(ucs_object_dn)
1299
			if not module.identify(ucs_object_dn, ldap_object_ucs):
1300
				for m in self.modules_others[property_type]:
1301
					if m and m.identify(ucs_object_dn, ldap_object_ucs):
1302
						module = m
1303
						ud.debug(ud.LDAP, ud.INFO, "Mapping to other module: %r" % (module,))
1304
						break
1305
				else:
1306
					ud.debug(ud.LDAP, ud.ERROR, "Could not identify UDM module for: %s dn: %s" % (property_type, ucs_object_dn))
1307
					return False
1308
1297
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=object['olddn'], position='')
1309
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=object['olddn'], position='')
1298
		ucs_object.open()
1310
		ucs_object.open()
1299
		ucs_object.move(object['dn'])
1311
		ucs_object.move(object['dn'])
 Lines 1356-1362    Link Here 
1356
				ud.debug(ud.LDAP, ud.PROCESS, "The windows computer %s is a Domain Controller in OpenLDAP. The deletion will be skipped." % object['dn'])
1368
				ud.debug(ud.LDAP, ud.PROCESS, "The windows computer %s is a Domain Controller in OpenLDAP. The deletion will be skipped." % object['dn'])
1357
				return True
1369
				return True
1358
1370
1359
		module = self.modules[property_type]
1371
		if self.modules_others[property_type]:
1372
			ucs_object_dn = object['dn']
1373
			ldap_object_ucs = self.get_ucs_ldap_object(ucs_object_dn)
1374
			if not module.identify(ucs_object_dn, ldap_object_ucs):
1375
				for m in self.modules_others[property_type]:
1376
					if m and m.identify(ucs_object_dn, ldap_object_ucs):
1377
						module = m
1378
						ud.debug(ud.LDAP, ud.INFO, "Mapping to other module: %r" % (module,))
1379
						break
1380
				else:
1381
					ud.debug(ud.LDAP, ud.ERROR, "Could not identify UDM module for: %s dn: %s" % (property_type, ucs_object_dn))
1382
					return False
1383
1360
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=object['dn'], position='')
1384
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=object['dn'], position='')
1361
1385
1362
		try:
1386
		try:

Return to bug 44770