Bug 30387 - Some computer types do not show up in "Needed Module"-list
Some computer types do not show up in "Needed Module"-list
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - Extended Attributes
UCS 4.1
Other Linux
: P4 normal with 1 vote (vote)
: UCS 4.3-2-errata
Assigned To: Dirk Wiesenthal
Johannes Keiser
:
: 31225 41880 (view as bug list)
Depends on:
Blocks: 47273
  Show dependency treegraph
 
Reported: 2013-02-11 12:23 CET by Janis Meybohm
Modified: 2019-07-25 18:16 CEST (History)
10 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.171
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2013052421000972, 2016072521000381, 2017052321000887, 2017110921000277
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Add computers/linux, wrap long lines, use @classmethod (10.59 KB, patch)
2013-06-28 17:43 CEST, Philipp Hahn
Details | Diff
Screenshot (66.82 KB, image/png)
2013-11-08 11:38 CET, Alexander Kläser
Details
patch?! (3.23 KB, patch)
2017-01-13 18:44 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2013-02-11 12:23:53 CET
Computer types like "computers/linux", "computers/ucc", "computers/ubuntu" (maybe others) do not show up in the drop down list of needed modules when creating/editing an extended attribute.
Comment 1 Alexander Kläser univentionstaff 2013-02-15 10:25:00 CET
The problem is the syntax class univentionAdminModules that predefines all valid modules:

> class univentionAdminModules(select):
>         # we need a fallback
>         choices=[('computers/managedclient', 'Computer: Managed Client'), ... ]
> ...

Maybe there is a feasible way to identify all existing modules dynamically.
Comment 2 Alexander Kläser univentionstaff 2013-05-03 10:57:11 CEST
*** Bug 31225 has been marked as a duplicate of this bug. ***
Comment 3 Philipp Hahn univentionstaff 2013-06-28 17:43:07 CEST
Ticket#: 2013052421000972 ] UCS Technikschulung

computers/linux was found missing.

syntax.py#update_choices only seems to be called for the CLI interface, but not for UDM UMC:

$ git grep update_choices
univention-directory-manager-modules/modules/univention/admin/syntax.py:def update_choices():
univention-directory-manager-modules/modules/univention/admincli/adduser.py:univention.admin.syntax.update_choices()
univention-directory-manager-modules/modules/univention/admincli/admin.py:univention.admin.syntax.update_choices()
univention-directory-manager-modules/scripts/change_srv_priority.py:univention.admin.syntax.update_choices()
univention-management-console-module-ipchange/umc/python/ipchange/__init__.py:univention.admin.syntax.update_choices()
Comment 4 Philipp Hahn univentionstaff 2013-06-28 17:43:52 CEST
Created attachment 5295 [details]
Add computers/linux, wrap long lines, use @classmethod
Comment 5 Michael Grandjean univentionstaff 2013-07-25 14:28:24 CEST
computers/ucc was found missing during QA for customer.
Comment 6 Alexander Kläser univentionstaff 2013-11-08 11:38:42 CET
Created attachment 5581 [details]
Screenshot

Several module entries are empty for the extended attribute "objectFlag" which is shipped with UCS 3.2:

> cn=objectFlag,cn=custom attributes,cn=univention,$ldap_base

See screenshot.
Comment 7 Philipp Hahn univentionstaff 2016-08-02 10:11:31 CEST
*** Bug 41880 has been marked as a duplicate of this bug. ***
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2017-01-13 18:20:19 CET
(In reply to Philipp Hahn from comment #4)
> Created attachment 5295 [details]
> Add computers/linux, wrap long lines, use @classmethod

This is not the correct fix. There is already an update function that actively searches for available UDM modules and updates the corresponding UDM syntax.
This works on the command line but does not in UMC.

I triggered this bug when trying to modify extended attributes that are attached to 3rd party UDM modules (oxmail/* & oxresources/*). The choices list is empty after opening the existing extended attribute and results in an error message if the user tries to save the EA object because the EA is attached to oxmail/* only.
If attached to standard UCS modules AND 3rd party modules, the 3rd party modules vanish from that list and if the EA object is saved, the assignment to those 3rd party modules is lost → information loss
Comment 9 Florian Best univentionstaff 2017-01-13 18:44:23 CET
Created attachment 8352 [details]
patch?!
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2017-01-15 21:56:15 CET
(In reply to Florian Best from comment #9)
> Created attachment 8352 [details]
> patch?!

Will it create problems with one of the numerous scripts that call modules.update() manually?

ucs-4.1-4$ rgrep -H 'modules.update[(][)]' | wc -l
43
Comment 11 Florian Best univentionstaff 2017-01-16 12:32:39 CET
(In reply to Sönke Schwardt-Krummrich from comment #10)
> (In reply to Florian Best from comment #9)
> > Created attachment 8352 [details]
> > patch?!
> 
> Will it create problems with one of the numerous scripts that call
> modules.update() manually?
No, we do this already twice in ucsschool.lib. But loading the syntax-choices at import time might not be good, because maybe some of them do a ldap connection? if so, we should add a syntax.choices_reload() also anywhere in UDM-UMC.
Comment 12 Sönke Schwardt-Krummrich univentionstaff 2017-01-17 09:58:38 CET
(In reply to Florian Best from comment #11)
> No, we do this already twice in ucsschool.lib. But loading the
> syntax-choices at import time might not be good, because maybe some of them
> do a ldap connection? if so, we should add a syntax.choices_reload() also
> anywhere in UDM-UMC.

IIRC syntaxes have to be static if it's not a ldapsearch/udm syntax.
Comment 13 Florian Best univentionstaff 2017-04-21 14:17:55 CEST
@Sönke: This needs to be fixed for OX, right? Or is there a workaround implemented in OX?
Comment 14 Sönke Schwardt-Krummrich univentionstaff 2017-05-29 11:07:14 CEST
(In reply to Florian Best from comment #13)
> @Sönke: This needs to be fixed for OX, right? Or is there a workaround
> implemented in OX?

Not that I'm aware of. I think our workaround works quite good.
Comment 15 Nico Stöckigt univentionstaff 2017-11-09 11:07:44 CET
still and again a customer struggled to create a designated extended attribute 'cause it's not possible to select specific modules - they're missing.
Comment 16 Dirk Wiesenthal univentionstaff 2018-11-27 16:44:38 CET
Fixed by calling update_choices() at the end of modules.update()
  univention-directory-manager-modules 13.0.25-22A~4.3.0.201811271640
Comment 17 Johannes Keiser univentionstaff 2018-11-29 12:01:59 CET
OK: Problems as described in Comment #0 Comment #8 are fixed
OK: YAML
-> verified
Comment 18 Arvid Requate univentionstaff 2018-12-05 14:38:55 CET
<http://errata.software-univention.de/ucs/4.3/355.html>