Bug 49235 - Remove unnecessary default values in univention.admin.property descriptions
Remove unnecessary default values in univention.admin.property descriptions
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-0-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-04 19:26 CEST by Florian Best
Modified: 2019-05-15 14:52 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:


Attachments
Script to drop default values of properties (1.03 KB, text/plain)
2019-04-11 16:13 CEST, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-04-04 19:26:45 CEST
It would save a lot of space if we remove all parameters which equal the default value in the definition of the univention.admin.propertiy() calls in each UDM handler.
Comment 1 Philipp Hahn univentionstaff 2019-04-11 16:09:29 CEST
Fixed in branch:
<https://git.knut.univention.de/univention/ucs/commits/phahn/49235-udm-default-properties?utf8=%E2%9C%93&search=Bug+%2349235>

 109 files changed, 17 insertions(+), 3812 deletions(-)

Reopen to merge.
Comment 2 Philipp Hahn univentionstaff 2019-04-11 16:13:07 CEST
Created attachment 9965 [details]
Script to drop default values of properties
Comment 3 Florian Best univentionstaff 2019-04-11 17:47:42 CEST
removing options=[] causes that every property has the same list instance. I think we should add something like:
self.options = options[:] into propterty.__init__().
Comment 4 Florian Best univentionstaff 2019-04-11 17:50:46 CEST
Otherwise everything looks great, you can merge it after comment #3 then.
Comment 5 Philipp Hahn univentionstaff 2019-04-18 20:31:06 CEST
[4.4-0] 000aca283e Bug #46466: univention-directory-manager-modules 14.0.12-25A~4.4.0.201904182018
 doc/errata/staging/univention-directory-manager-modules.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[4.4-0] 131d8e26b3 Bug #49235 udm: Remove default values of properties

Package: univention-directory-manager-modules
Version: 14.0.12-25A~4.4.0.201904182018
Branch: ucs_4.4-0
Scope: errata4.4-0

(In reply to Florian Best from comment #3)
> removing options=[] causes that every property has the same list instance. I
> think we should add something like:
> self.options = options[:] into propterty.__init__().

Good catch; I changed it slightly differently and I'm using
  self.options = options or []
  self.licence = licence or []
which only instantiates a list if the passed-in (default) list is empty.
Comment 6 Philipp Hahn univentionstaff 2019-04-23 12:17:52 CEST
[4.4-0] 131d8e26b3 Bug #49235 udm: Remove default values of properties
[4.4-0] 6423bbd411 Bug #49235 udm: Remove default values of properties
[4.4-0] bfeffd196e Bug #49235 udm: Drop default property copyable=False|0
[4.4-0] 1ca8f5a32f Bug #49235 udm: Drop default property readonly_when_synced=False|0
[4.4-0] 09ef5159ef Bug #49235 udm: Drop default property include_in_default_search=False|0
[4.4-0] 20ec93a667 Bug #49235 udm: Drop default property editable=True|1
[4.4-0] 279bf4efef Bug #49235 udm: Drop default property show_in_lists=False|0
[4.4-0] b548cb8100 Bug #49235 udm: Drop default property dontsearch=False|0
[4.4-0] 0a92e273f7 Bug #49235 udm: Drop default property default=None
[4.4-0] 18d5b22abd Bug #49235 udm: Drop default property identifies=False|0
[4.4-0] cf70e966d9 Bug #49235 udm: Drop default property may_change=True|1
[4.4-0] 77f9f6232f Bug #49235 udm: Drop default property required=False|0
[4.4-0] 430fc5f472 Bug #49235 udm: Drop default property options=\[\]
[4.4-0] 2746a80b10 Bug #49235 udm: Unshare list for options and license
[4.4-0] f2063323f1 Bug #49235 udm: Drop default property multivalue=False|0

Package: univention-directory-manager-modules
Version: 14.0.12-25A~4.4.0.201904182018
Branch: ucs_4.4-0
Scope: errata4.4-0

[4.4-0] 763efd6990 Bug #49235: univention-directory-manager-modules 14.0.12-25A~4.4.0.201904182018
 doc/errata/staging/univention-directory-manager-modules.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 Florian Best univentionstaff 2019-04-29 11:11:52 CEST
OK
Comment 8 Arvid Requate univentionstaff 2019-04-30 13:29:59 CEST
[FAIL] changes.valid: Mismatching binary package version: 14.0.12-25A~4.4.0.201904182018 != python-univention-directory-manager-cli 14.0.12-27A~4.4.0.201904301002 from univention-directory-manager-modules 14.0.12-27A~4.4.0.201904301002
Comment 9 Arvid Requate univentionstaff 2019-04-30 13:34:52 CEST
That's caused by Bug 48390.
Comment 10 Arvid Requate univentionstaff 2019-05-15 14:52:25 CEST
<http://errata.software-univention.de/ucs/4.4/102.html>