Univention Bugzilla – Attachment 8207 Details for
Bug 37388
S4 connector does not support renaming windows clients
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
windowscomputer_sync_s4_to_ucs_check_rename.patch
windowscomputer_sync_s4_to_ucs_check_rename.patch (text/plain), 1.75 KB, created by
Arvid Requate
on 2016-11-09 13:26:33 CET
(
hide
)
Description:
windowscomputer_sync_s4_to_ucs_check_rename.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2016-11-09 13:26:33 CET
Size:
1.75 KB
patch
obsolete
>Index: conffiles/etc/univention/s4connector/s4/mapping.py >=================================================================== >--- conffiles/etc/univention/s4connector/s4/mapping.py (Revision 74173) >+++ conffiles/etc/univention/s4connector/s4/mapping.py (Arbeitskopie) >@@ -561,6 +561,7 @@ > @!@ > univention.s4connector.s4.password.password_sync_s4_to_ucs_no_userpassword, > univention.s4connector.s4.computer.checkAndConvertToMacOSX, >+ univention.s4connector.s4.computer.windowscomputer_sync_s4_to_ucs_check_rename, > ], > > attributes= { >Index: modules/univention/s4connector/s4/computer.py >=================================================================== >--- modules/univention/s4connector/s4/computer.py (Revision 74173) >+++ modules/univention/s4connector/s4/computer.py (Arbeitskopie) >@@ -91,3 +91,27 @@ > return > > _convertWinToMac(s4connector, sync_object) >+ >+def windowscomputer_sync_s4_to_ucs_check_rename(s4connector, key, sync_object): >+ ud.debug(ud.LDAP, ud.INFO, "con_check_rename: ucs_object: %s" % sync_object) >+ >+ attrs = sync_object.get('attributes') >+ if not attrs: >+ return >+ >+ uid = attrs.get('uid', [None])[0] >+ if not uid: >+ raise ValueError("%s has no uid" % (sync_object['dn'],)) >+ >+ ## Raises IndexError if neither cn nor CN is found in object: >+ cn = [_value for _key, _value in attrs.iteritems() if 'cn' == _key.lower()][0] >+ >+ normal_cn = uid.rstrip('$') >+ if cn == normal_cn: >+ return >+ >+ ud.debug(ud.LDAP, ud.PROCESS, "con_check_rename: Renaming client from %s to %s" % (cn, normal_cn)) >+ ucs_admin_object = univention.admin.objects.get(s4connector.modules['windowscomputer'], co='', lo=s4connector.lo, position='', dn=sync_object['dn']) >+ ucs_admin_object.open() >+ ucs_admin_object['name'] = normal_cn >+ ucs_admin_object.modify()
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 37388
: 8207