Univention Bugzilla – Bug 57439
repair univention-sync-memberuid
Last modified: 2024-07-31 15:54:29 CEST
In a 5.0-8 environment, the group memberships are extremly mixed up. Trying to fix this issue with running this nice script fails, because the script was not running at all. Introducing the new logging method, the script was tracebacking. That fix, makes it running again. --- /usr/share/univention-directory-manager-tools/univention-sync-memberuid 2024-06-24 12:50:00.000000000 +0200 +++ univention-sync-memberuid 2024-07-08 17:07:33.345255000 +0200 @@ -42,7 +42,7 @@ import sys from argparse import ArgumentParser from logging import getLogger - +import logging import ldap import univention.config_registry @@ -73,7 +73,7 @@ options = parser.parse_args() - univention.logging.basicConfig(filename='/var/log/univention/sync-memberuid.log', univention_debug_level=options.debug) + logging.basicConfig(filename='/var/log/univention/sync-memberuid.log', level=options.debug) base_dn = configRegistry['ldap/base'] It would also be nice, if the logging writes timestamps in the logfile. So maybe we improve the script a little bit, maybe also with specification of groups, which should be fixed, instead of trying to fix everything, because in big environments this causes trouble in addition. BTW same with the proof_uniqueMembers script, which takes about 8 hours in this environment and is therefor not usable for the customer.
univention-directory-manager-modules.yaml e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid univention-directory-manager-modules (15.0.27-4) e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid ucs-test (10.0.22-36) e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid The initial error could be fixed by simply importing univention.logging. However I also added some modernization and features. - Switched from using raw ldap connection to univention.admin.uldap - Added include and exclude lists Build: Successful build Package: univention-directory-manager-modules Version: 15.0.27-4 Branch: 5.0-0 Scope: errata5.0-8 Successful build Package: univention-directory-manager-modules Version: 17.0.14 Branch: 5.2-0 Successful build Package: ucs-test Version: 10.0.22-36 Branch: 5.0-0 Scope: errata5.0-8 Successful build Package: ucs-test Version: 12.0.124 Branch: 5.2-0
QA: OK: manual testing OK: `univention-sync-memberuid` syncs uniqueMember attribute to memberUID attribute OK: new flags -g and -x (create include and exclude lists) OK: advisories OK: code review OK: new test OK: build 5.0-8 and 5.2-0
<https://errata.software-univention.de/#/?erratum=5.0x1092>