Bug 43068 - Cleanup dead code in the s4-connector
Cleanup dead code in the s4-connector
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.4
Other Linux
: P5 enhancement (vote)
: UCS 4.4-1-errata
Assigned To: Florian Best
Arvid Requate
:
: 26030 39484 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-28 16:52 CET by Lukas Oyen
Modified: 2019-08-22 15:29 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup
Max CVSS v3 score:
oyen: Patch_Available+


Attachments
Patch-series with dead code cleanup. (30.00 KB, application/x-tar)
2016-11-28 16:52 CET, Lukas Oyen
Details
Patch-series with dead code cleanup. (30.00 KB, application/x-tar)
2017-02-16 14:06 CET, Lukas Oyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Oyen univentionstaff 2016-11-28 16:52:06 CET
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
Comment 1 Lukas Oyen univentionstaff 2016-11-30 13:46:25 CET
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.
Comment 2 Lukas Oyen univentionstaff 2017-02-16 14:06:25 CET
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.
Comment 3 Florian Best univentionstaff 2017-03-09 16:47:25 CET
Should be done together with Bug #41554.
Comment 4 Florian Best univentionstaff 2017-04-24 17:08:41 CEST
*** Bug 26030 has been marked as a duplicate of this bug. ***
Comment 5 Lukas Oyen univentionstaff 2017-09-11 16:03:11 CEST
Code rebased on 4.2-2 in branch loyen/43068-s4connector-eliminate-dead-code-422.
Comment 6 Florian Best univentionstaff 2019-08-08 15:01:21 CEST
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
Comment 7 Florian Best univentionstaff 2019-08-08 16:43:16 CEST
*** Bug 39484 has been marked as a duplicate of this bug. ***
Comment 8 Arvid Requate univentionstaff 2019-08-09 10:00:31 CEST
Verified:
* Code review
* Jenkins test results
* Advisory
Comment 9 Arvid Requate univentionstaff 2019-08-22 15:29:55 CEST
<http://errata.software-univention.de/ucs/4.4/239.html>