Univention Bugzilla – Bug 32084
AttributeError: 'module' object has no attribute 'lookup_filter'
Last modified: 2013-11-19 06:42:07 CET
Die Ausführung des Kommandos udm/syntax/choices/info ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 282, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 384, in _response for res in function(self, iterator, *nones): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 266, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 829, in syntax_choices_info return info_syntax_choices(syntax) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 1070, in info_syntax_choices size += len( module.search( filter = filter_s, simple=not syn.use_objects ) ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 155, in wrapper_func ret = func( *args, **kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 430, in search if simple and self.allows_simple_lookup(): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 236, in allows_simple_lookup return bool(getattr( self.module, 'lookup_filter' )) AttributeError: 'module' object has no attribute 'lookup_filter' {"options":{"syntax":"UvmmProfiles"},"flavor":"navigation"} Happens when opening a UVMM-domain in LDAP directory → Virtual Machine Manager → Information. It should also be checked if the UVMM-module is incorrect.
@Dirk: Has that something to do with your changes in Bug 31560 ?
Yes. Last line in the traceback should be - return bool(getattr( self.module, 'lookup_filter' )) + return hasattr( self.module, 'lookup_filter' )
(In reply to Dirk Wiesenthal from comment #2) > Yes. Last line in the traceback should be > > - return bool(getattr( self.module, 'lookup_filter' )) > + return hasattr( self.module, 'lookup_filter' ) What about the erratum? Does this prevent 3.1-1 from working correctly with UVMM?
(In reply to Dirk Wiesenthal from comment #2) > Yes. Last line in the traceback should be > > - return bool(getattr( self.module, 'lookup_filter' )) > + return hasattr( self.module, 'lookup_filter' ) (No!?, is lookup_filter a method or maybe None or a bool?) → bool(getattr( self.module, 'lookup_filter', None )) and what is with the function call in the "lookup_filter" method?
(In reply to Alexander Kläser from comment #3) > (In reply to Dirk Wiesenthal from comment #2) > > Yes. Last line in the traceback should be > > > > - return bool(getattr( self.module, 'lookup_filter' )) > > + return hasattr( self.module, 'lookup_filter' ) > > What about the erratum? Does this prevent 3.1-1 from working correctly with > UVMM? Should not require an erratum update, although it is broken. File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 236, in allows_simple_lookup return bool(getattr( self.module, 'lookup_filter' )) This was meant to be a second safety net. It is broken. But it is only called when a Syntax says use_objects=False. And in these cases lookup_filter is always present (because it is just a defined set of syntax classes in 3.1-1). UvmmProfiles do not exist in 3.1-1 and even if they surely would have use_objects=True
Fixed in 3.2-0: univention-management-console-module-udm 4.0.10-1.330.201307261803
(In reply to Florian Best from comment #4) > and what is with the function call in the "lookup_filter" method? Will raise. It is a function call on a wrapper with an underlying object lacking that functionality. Returning None would have to handled equally. Currently lookup_filter() is only used if allows_simple_lookup(). If someone wants to use it somewhere else he has to take care of that himself.
The call works now. I called it explicitely via: > require('umc/tools').umcpCommand('udm/syntax/choices/info', {"syntax":"UvmmProfiles"}, true, 'navigation') This particular syntax has also been adapted for speed up via Bug 24774. Changelog → not necessary.
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".