View | Details | Raw Unified | Return to bug 46470
Collapse All | Expand All

(-)a/services/univention-s4-connector/modules/univention/s4connector/__init__.py (-3 / +4 lines)
 Lines 837-844   class ucs: Link Here 
837
				change_type = "modify"
837
				change_type = "modify"
838
				ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was modified")
838
				ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was modified")
839
				if old_dn and not old_dn == dn:
839
				if old_dn and not old_dn == dn:
840
					change_type = "move"
840
					ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was moved")
841
					ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was moved")
841
					# object was moved
842
					new_object = {'dn': unicode(dn, 'utf8'), 'modtype': change_type, 'attributes': new}
842
					new_object = {'dn': unicode(dn, 'utf8'), 'modtype': change_type, 'attributes': new}
843
					old_object = {'dn': unicode(old_dn, 'utf8'), 'modtype': change_type, 'attributes': old}
843
					old_object = {'dn': unicode(old_dn, 'utf8'), 'modtype': change_type, 'attributes': old}
844
					if self._ignore_object(key, new_object):
844
					if self._ignore_object(key, new_object):
 Lines 862-868   class ucs: Link Here 
862
						return True
862
						return True
863
					else:
863
					else:
864
						if old_dn and not old_dn == dn:
864
						if old_dn and not old_dn == dn:
865
							change_type = "modify"
865
							change_type = "move"
866
							ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was moved")
866
							ud.debug(ud.LDAP, ud.INFO, "__sync_file_from_ucs: object was moved")
867
						else:
867
						else:
868
							change_type = "add"
868
							change_type = "add"
 Lines 885-891   class ucs: Link Here 
885
			else:
885
			else:
886
				object = {'dn': unicode(dn, 'utf8'), 'modtype': change_type, 'attributes': new}
886
				object = {'dn': unicode(dn, 'utf8'), 'modtype': change_type, 'attributes': new}
887
887
888
			if change_type == 'modify' and old_dn:
888
			if change_type in ('modify', 'move') and old_dn:
889
				object['olddn'] = unicode(old_dn, 'utf8')  # needed for correct samaccount-mapping
889
				object['olddn'] = unicode(old_dn, 'utf8')  # needed for correct samaccount-mapping
890
890
891
			if not self._ignore_object(key, object) or ignore_subtree_match:
891
			if not self._ignore_object(key, object) or ignore_subtree_match:
 Lines 1497-1502   class ucs: Link Here 
1497
			ud.debug(ud.LDAP, ud.INFO, "sync_to_ucs ignored, sync_mode is %s" % self.property[property_type].sync_mode)
1497
			ud.debug(ud.LDAP, ud.INFO, "sync_to_ucs ignored, sync_mode is %s" % self.property[property_type].sync_mode)
1498
			return True
1498
			return True
1499
1499
1500
		# Update modtype if necessary
1500
		ucs_object_dn = object.get('olddn', object['dn'])
1501
		ucs_object_dn = object.get('olddn', object['dn'])
1501
		old_object = self.get_ucs_object(property_type, ucs_object_dn)
1502
		old_object = self.get_ucs_object(property_type, ucs_object_dn)
1502
		if old_object and object['modtype'] == 'add':
1503
		if old_object and object['modtype'] == 'add':
(-)a/services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py (-2 / +2 lines)
 Lines 2499-2505   class s4(univention.s4connector.ucs): Link Here 
2499
		#
2500
		#
2500
		# ADD
2501
		# ADD
2501
		#
2502
		#
2502
		if (object['modtype'] == 'add' and not s4_object) or (object['modtype'] == 'modify' and not s4_object):
2503
		if not s4_object and object['modtype'] in ('add', 'modify', 'move'):
2503
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: add object: %s" % object['dn'])
2504
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: add object: %s" % object['dn'])
2504
2505
2505
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: lock UCS entryUUID: %s" % entryUUID)
2506
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: lock UCS entryUUID: %s" % entryUUID)
 Lines 2602-2608   class s4(univention.s4connector.ucs): Link Here 
2602
		#
2603
		#
2603
		# MODIFY
2604
		# MODIFY
2604
		#
2605
		#
2605
		elif (object['modtype'] == 'modify' and s4_object) or (object['modtype'] == 'add' and s4_object):
2606
		elif s4_object and object['modtype'] in ('add', 'modify', 'move'):
2606
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: modify object: %s" % object['dn'])
2607
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: modify object: %s" % object['dn'])
2607
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: old_object: %s" % old_ucs_object)
2608
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: old_object: %s" % old_ucs_object)
2608
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: new_object: %s" % new_ucs_object)
2609
			ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: new_object: %s" % new_ucs_object)

Return to bug 46470