Bug 35925 - Not possible to search for settings/printermodel (Printer Driver List)
Not possible to search for settings/printermodel (Printer Driver List)
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Johannes Keiser
Florian Best
Depends on:
  Show dependency treegraph
Reported: 2014-09-15 09:30 CEST by Florian Best
Modified: 2017-07-05 13:06 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, External feedback, Usability
Max CVSS v3 score:
best: Patch_Available+

patch (1.49 KB, patch)
2016-03-22 07:38 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2014-09-15 09:30:22 CEST
  File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line
509, in _thread
    result = module.search( request.options.get( 'container' ), request.options[
'objectProperty' ], request.options[ 'objectPropertyValue' ], superordinate, scope =
request.options.get( 'scope', 'sub' ), hidden=request.options.get('hidden') )
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line
184, in wrapper_func
    ret = func( *args, **kwargs )
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line
471, in search
    result = self.module.lookup( None, ldap_connection, filter_s, base = container,
superordinate = superordinate, scope = scope, sizelimit = sizelimit )
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/settings/printermodel.py",
line 130, in lookup
    univention.admin.filter.walk(filter_p, univention.admin.mapping.mapRewrite,
  File "/usr/lib/pymodules/python2.6/univention/admin/filter.py", line 207, in walk
    walk(e, expression_walk_function, conjunction_walk_function, arg)
  File "/usr/lib/pymodules/python2.6/univention/admin/filter.py", line 212, in walk
    expression_walk_function(filter, arg)
  File "/usr/lib/pymodules/python2.6/univention/admin/mapping.py", line 253, in mapRewrite
    v=mapping.mapValue(filter.variable, filter.value)
  File "/usr/lib/pymodules/python2.6/univention/admin/mapping.py", line 181, in mapValue
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/settings/printermodel.py",
line 96, in mapDriverList
    str.append('"%s" "%s"' % ( i[ 0 ], i[ 1 ] ) )

IndexError: string index out of range

Suche im LDAP Baum: Univention:cups, Typ: Druckertreiberliste, Standardeigenschaften,
Suchstring: Kyocera

Reproducible with every search string, the logs contain:

Searching for LDAP objects: container = dc=system,dc=setup, filter = (|(name=*Kyocera*)(printmodel=*Kyocera*)), superordinate = None
#### mapDriverList: '*Kyocera*'

Also reproducible on CLI with the command:
udm settings/printermodel list --filter 'printmodel=*Kyocera*'

Maybe there is a call to unmapDriverList missing or something?
Comment 1 Florian Best univentionstaff 2016-03-22 07:38:21 CET
Created attachment 7548 [details]
Comment 2 Johannes Keiser univentionstaff 2017-06-30 15:32:10 CEST
(In reply to Florian Best from comment #1)
> Created attachment 7548 [details]
> patch

Applied rebased patch:

r 80684
univention-directory-manager-modules (12.0.17-39) 
* Bug #35925: Applied patch from Florian Best - Fix traceback when searching
for printmodel property on settings/printermodel

YAML: r 80686
Comment 3 Florian Best univentionstaff 2017-06-30 15:45:48 CEST
OK: searching in UMC for the printmodel works
OK: YAML (adjusted in 80687)
Comment 4 Janek Walkenhorst univentionstaff 2017-07-05 13:06:13 CEST