Univention Bugzilla – Bug 41266
remove dead code from custom-attributes
Last modified: 2016-09-29 17:30:59 CEST
The migration from custom attributes to extended attributes partly failed. The old univentionAdminProperty*-attributes have been renamed into univentionUDMProperty*. Some code was not migrated to use the new attributes, which leads to never executed code: modules.py: for dn, attrs in lo.search(base=position.getDomainConfigBase(), filter='(&(objectClass=univentionAdminProperty)(univentionAdminPropertyModule=%s))' % name(module)): modules.py: propertySyntaxString=attrs.get('univentionAdminPropertySyntax', [''])[0] modules.py: propertyDefault = attrs.get('univentionAdminPropertyDefault', [''])[0] modules.py: if attrs.get('univentionAdminPropertyMultivalue', [''])[0] == '1': modules.py: short_description=attrs['univentionAdminPropertyShortDescription'][0], modules.py: long_description=attrs.get('univentionAdminPropertyLongDescription',[''])[0], modules.py: if attrs['univentionAdminPropertyLdapMapping'][0].upper() != 'ObjectClass'.upper(): modules.py: module.mapping.register(pname, attrs['univentionAdminPropertyLdapMapping'][0], None, map_method) modules.py: module.mapping.register(pname, attrs['univentionAdminPropertyLdapMapping'][0], univention.admin.mapping.nothing, univention.admin.mapping.nothing) modules.py: deleteValues=attrs.get('univentionAdminPropertyDeleteValues') modules.py: tabname = attrs.get('univentionAdminPropertyLayoutTabName',[_('Custom')])[0] modules.py: if attrs.get('univentionAdminPropertyDeleteObjectClass'): modules.py: deleteObjectClass=attrs.get('univentionAdminPropertyDeleteObjectClass')[0] modules.py: tabposition = attrs.get('univentionAdminPropertyLayoutPosition',['-1'])[0] modules.py: module.ldap_extra_objectclasses.extend( ([(attrs.get('univentionAdminPropertyObjectClass', [])[0], pname, propertySyntaxString, attrs['univentionAdminPropertyLdapMapping'][0], deleteValues, deleteObjectClass )])) We should remove the code or reintegrate the broken/missing features.
Removed that code during working on Bug #25240. It costs a lot of time to always read broken code. univention-directory-manager-modules (11.0.2-30): r69513 | Bug #41266: remove dead custom-attributes code univention-directory-manager-modules.yaml: r69515 | YAML Bug #41266 Bug #25240
*** Bug 31769 has been marked as a duplicate of this bug. ***
r69538 | Bug #41266: removed some more unused custom-attributes code
(In reply to Florian Best from comment #1) > Removed that code during working on Bug #25240. It costs a lot of time to > always read broken code. > > univention-directory-manager-modules (11.0.2-30): > r69513 | Bug #41266: remove dead custom-attributes code REOPEN: Please remove the code in _ldap_modlist() completely instead of out-commenting it. > univention-directory-manager-modules.yaml: > r69515 | YAML Bug #41266 Bug #25240 OK (In reply to Florian Best from comment #3) > r69538 | Bug #41266: removed some more unused custom-attributes code OK (In reply to Florian Best from comment #2) > *** Bug 31769 has been marked as a duplicate of this bug. *** REOPEN: More CA related code to be removed in etc/bash_completion.d/univention-directory-manager test/univention-admin-test modules/univention/admin/__init__.py
(In reply to Philipp Hahn from comment #4) > REOPEN: Please remove the code in _ldap_modlist() completely instead of > out-commenting it. That code contains information which are still valid and should be reimplemented some day. > REOPEN: More CA related code to be removed in > etc/bash_completion.d/univention-directory-manager Yes, fixed. > test/univention-admin-test That scripts seems broken, the LDAP server doesn't start after applying the schema in there. Nevertheless is converted custom-attributes → extended attributes in there. > modules/univention/admin/__init__.py I don't see Code in there which still refers to custom attributes (only two comments which have been adjusted). univention-directory-manager-modules (11.0.3-2): r69968 | Bug #41266: remove more custom attribute related code
(In reply to Florian Best from comment #5) > (In reply to Philipp Hahn from comment #4) > > REOPEN: Please remove the code in _ldap_modlist() completely instead of > > out-commenting it. > That code contains information which are still valid and should be > reimplemented some day. Such commented out code tends to get stale very quickly because nobody will touch it or keep it up-to-date. We have source code control for archaeologists, so please remove it.
(In reply to Florian Best from comment #5) > (In reply to Philipp Hahn from comment #4) > > REOPEN: Please remove the code in _ldap_modlist() completely instead of > > out-commenting it. > That code contains information which are still valid and should be > reimplemented some day. Such commented out code tends to get stale very quickly because nobody will touch it or keep it up-to-date. The source code is no TODO-list or issue tracking system; please file a new bug to re-implement it if necessary; then management can decide on the importance. We also have source code control if someone wants to lookup old code, so please remove it.
Your wish is my command. univention-directory-manager-modules (11.0.3-3): r70014 | Bug #41266: remove commented out code
OK: r69968 r70014 TODO: Bug #41553, Bug #41554, Bug #41556 FIXED: errata-announce -V univention-directory-manager-modules.yaml r70158 | Bug #41266 udm-modules: YAML v++ OK: EA & EO still work
<http://errata.software-univention.de/ucs/4.1/199.html>