Univention Bugzilla – Attachment 8347 Details for
Bug 42618
AD Connector: configure sync_mode on attribute level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Implement per Attribute `sync_mode`.
0001-Bug-42618-ad-connector-implement-per-attribute-sync_.patch (text/plain), 3.46 KB, created by
Lukas Oyen
on 2017-01-11 14:49:17 CET
(
hide
)
Description:
Implement per Attribute `sync_mode`.
Filename:
MIME Type:
Creator:
Lukas Oyen
Created:
2017-01-11 14:49:17 CET
Size:
3.46 KB
patch
obsolete
>From 78335ce6cabbdf5b7e662bdbd4682ebc43f15ffe Mon Sep 17 00:00:00 2001 >From: Lukas Oyen <oyen@univention.de> >Date: Mon, 9 Jan 2017 17:02:42 +0100 >Subject: [PATCH] Bug #42618: ad-connector: implement per attribute `sync_mode` > >--- > .../modules/univention/connector/__init__.py | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > >diff --git a/services/univention-ad-connector/modules/univention/connector/__init__.py b/services/univention-ad-connector/modules/univention/connector/__init__.py >index f90c982..42b32aa 100644 >--- a/services/univention-ad-connector/modules/univention/connector/__init__.py >+++ b/services/univention-ad-connector/modules/univention/connector/__init__.py >@@ -320,7 +320,7 @@ class configsaver: > > class attribute: > >- def __init__(self, ucs_attribute='', ldap_attribute='', con_attribute='', con_other_attribute='', required=0, compare_function='', con_value_map_function='', ucs_value_map_function='', mapping=(), reverse_attribute_check=False): >+ def __init__(self, ucs_attribute='', ldap_attribute='', con_attribute='', con_other_attribute='', required=0, compare_function='', con_value_map_function='', ucs_value_map_function='', mapping=(), reverse_attribute_check=False, sync_mode='sync'): > self.ucs_attribute = ucs_attribute > self.ldap_attribute = ldap_attribute > self.con_attribute = con_attribute >@@ -339,6 +339,8 @@ class attribute: > # Seee https://forge.univention.org/bugzilla/show_bug.cgi?id=25823 > self.reverse_attribute_check = reverse_attribute_check > >+ self.sync_mode = sync_mode >+ > > class property: > >@@ -1096,7 +1098,8 @@ class ucs: > ud.debug(ud.LDAP, ud.WARN, '__set_values: The attributes for %s have not been removed as it represents a mandatory attribute' % ucs_key) > > for attr_key in self.property[property_type].attributes.keys(): >- set_values(self.property[property_type].attributes[attr_key]) >+ if self.property[property_type].attributes[attr_key].sync_mode in ['read', 'sync']: >+ set_values(self.property[property_type].attributes[attr_key]) > > # post-values > if not self.property[property_type].post_attributes: >@@ -1106,13 +1109,14 @@ class ucs: > if hasattr(self.property[property_type].post_attributes[attr_key], 'mapping'): > set_values(self.property[property_type].post_attributes[attr_key].mapping[1](self, property_type, object)) > else: >- if self.property[property_type].post_attributes[attr_key].reverse_attribute_check: >- if object['attributes'].get(self.property[property_type].post_attributes[attr_key].ldap_attribute): >- set_values(self.property[property_type].post_attributes[attr_key]) >+ if self.property[property_type].post_attributes[attr_key].sync_mode in ['read', 'sync']: >+ if self.property[property_type].post_attributes[attr_key].reverse_attribute_check: >+ if object['attributes'].get(self.property[property_type].post_attributes[attr_key].ldap_attribute): >+ set_values(self.property[property_type].post_attributes[attr_key]) >+ else: >+ ucs_object[self.property[property_type].post_attributes[attr_key].ucs_attribute] = '' > else: >- ucs_object[self.property[property_type].post_attributes[attr_key].ucs_attribute] = '' >- else: >- set_values(self.property[property_type].post_attributes[attr_key]) >+ set_values(self.property[property_type].post_attributes[attr_key]) > > def __modify_custom_attributes(self, property_type, object, ucs_object, module, position, modtype="modify"): > if 'custom_attributes' in object: >-- >2.7.4 >
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 42618
: 8347