Univention Bugzilla – Attachment 6884 Details for
Bug 38450
S4-Connector could check if a rejected changeset is obsolete (and futile)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
skip_attribute_modification_if_current_value_in_sync.patch
skip_attribute_modification_if_current_value_in_sync.patch (text/plain), 2.79 KB, created by
Arvid Requate
on 2015-05-07 19:58:33 CEST
(
hide
)
Description:
skip_attribute_modification_if_current_value_in_sync.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2015-05-07 19:58:33 CEST
Size:
2.79 KB
patch
obsolete
>Index: modules/univention/s4connector/s4/__init__.py >=================================================================== >--- modules/univention/s4connector/s4/__init__.py (Revision 60543) >+++ modules/univention/s4connector/s4/__init__.py (Arbeitskopie) >@@ -2396,6 +2396,12 @@ > ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: new_object: %s" % new_ucs_object) > object['old_ucs_object'] = old_ucs_object > object['new_ucs_object'] = new_ucs_object >+ try: >+ current_ucs_object = self.lo.get(object['dn']) >+ object['current_ucs_object'] = current_ucs_object >+ except ldap.NO_SUCH_OBJECT: >+ pass >+ > attribute_list = set(old_ucs_object.keys()).union(set(new_ucs_object.keys())) > if hasattr(self.property[property_type],"con_sync_function"): > self.property[property_type].con_sync_function(self, property_type, object) >@@ -2438,9 +2444,19 @@ > modify=True > > if not modify: >- ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: no modification necessary for %s" % attribute) >+ ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: values did not change for %s" % attribute) > continue > >+ current_s4_values = set(s4_object.get(s4_attribute, [])) >+ ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: The current S4 values: %s" % current_s4_values) >+ >+ if 'current_ucs_object' in object: >+ current_values = set(object['current_ucs_object'].get(attribute, [])) >+ ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: cur_values: %s" % current_values) >+ if current_values == current_s4_values: >+ ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: no modification necessary for %s" % attribute) >+ continue >+ > # So, at this point we have the old and the new UCS object. > # Thus we can create the diff, but we have to check the current S4 object > >@@ -2456,9 +2472,6 @@ > > if s4_other_attribute: > # in this case we need lists because sets are unorded and the order is important >- current_s4_values = set(s4_object.get(s4_attribute, [])) >- ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: The current S4 values: %s" % current_s4_values) >- > current_s4_other_values = set(s4_object.get(s4_other_attribute, [])) > ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: The current S4 other values: %s" % current_s4_other_values) > >@@ -2480,10 +2493,6 @@ > if current_s4_other_values != new_s4_other_values: > modlist.append((ldap.MOD_REPLACE, s4_other_attribute, new_s4_other_values)) > else: >- current_s4_values = set(s4_object.get(s4_attribute, [])) >- >- ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: The current S4 values: %s" % current_s4_values) >- > if (to_add or to_remove) and attribute_type[attribute].single_value: > modify=False > if not current_s4_values or not value:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38450
: 6884 |
6885
|
6886