Univention Bugzilla – Bug 43068
Cleanup dead code in the s4-connector
Last modified: 2019-08-22 15:29:55 CEST
Created attachment 8249 [details] Patch-series with dead code cleanup. The s4-connector contains a lot of dead code. The attached patch-series cleans up: 1) unused variables 2) unused/redundant imports 3) unused functions 4) unused files All s4-connector tests are still passing on a single UCS 4.1-4 errata 327. The removed functions are: - def _list_dn_mappings(..) - def list_dn_mappings_by_con(..) - def list_dn_mappings_by_ucs(..) - def old_user_dn_mapping(..) - def encode_sid(..) - def encode_object_sid(..) - def encode_object_sid_to_binary_ldapfilter(..) - def unicode_list(..) - def __check_base64(..) - def ucs2s4_sid(..) - def s42ucs_sid(..) - def ucs2s4_givenName(..) - def s42ucs_givenName(..) - def ucs2s4_dn_string(..) - def ucs2s4_dn(..) - def s42ucs_dn_string(..) - def s42ucs_dn(..) - def ucs2s4_user_dn(..) - def s42ucs_user_dn(..) - def ucs2s4_sambaGroupType(..) - def s42ucs_sambaGroupType(..) - def ntsd_to_s4_mapping(..) - def ntsd_to_ucs_mapping(..) - def _append_string(..) - def _append(..) - def _append_array(..) - def _get_integer(..) - def fixup(..) The removed files are: - s4connector/s4/map - s4connector/s4/query_config.py
See https://forge.univention.org/bugzilla/show_bug.cgi?id=32086#c2 If the s4connector LDAP filter/DN-escaping is merged, univention.s4connector.s4.explode_unicode_dn() could also be removed, rendering https://forge.univention.org/bugzilla/show_bug.cgi?id=39484 obsolete.
Created attachment 8430 [details] Patch-series with dead code cleanup. (In reply to Lukas Oyen from comment #1) > See https://forge.univention.org/bugzilla/show_bug.cgi?id=32086#c2 > > If the s4connector LDAP filter/DN-escaping is merged, > univention.s4connector.s4.explode_unicode_dn() could also be removed, > rendering https://forge.univention.org/bugzilla/show_bug.cgi?id=39484 > obsolete. As the changes for bug #32086 are committed, I updated the patch-series to also remove `univention.s4connector.s4.explode_unicode_dn()` and rebased to the current 4.2-0 branch.
Should be done together with Bug #41554.
*** Bug 26030 has been marked as a duplicate of this bug. ***
Code rebased on 4.2-2 in branch loyen/43068-s4connector-eliminate-dead-code-422.
Applied patch from Lukas. Skipped two Patches: * remove unused file query_config.py * remove unused import in conffiles/mapping.py univention-s4-connector (13.0.2-30) d55c7656dad9 | Bug #43068: s4connector: remove unused imports/functions/variables in s4/__init__.py 557f0fa6c172 | Bug #43068: s4connector: remove unused functions in s4connector/__init__.py 6cd9fc06585f | Bug #43068: s4connector: remove unused import in s4cache.py 9ca407e908a5 | Bug #43068: s4connector: remove unused import in lockingdb.py 572700bdc492 | Bug #43068: s4connector: remove unused functions in ntsecurity_descriptor.py 469a15f8fb13 | Bug #43068: s4connector: remove unused functions in password.py 2a1680a2ac96 | Bug #43068: s4connector: remove unused junk comment in dc.py e84da0a81cfd | Bug #43068: s4connector: remove unused import in computer.py c84a9c865b1d | Bug #43068: remove dead code
*** Bug 39484 has been marked as a duplicate of this bug. ***
Verified: * Code review * Jenkins test results * Advisory
<http://errata.software-univention.de/ucs/4.4/239.html>