|
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': |