Univention Bugzilla – Bug 35273
traceback caused by get_exception_msg()
Last modified: 2015-01-26 10:19:16 CET
This function causes the following traceback, as received by a feedback-report. 73 def get_exception_msg(e): 74 » msg = getattr(e, 'message', '') 75 » if getattr(e, 'args', False): 76 » » if e.args[0] != msg or len(e.args) != 1: 77 » » » for arg in e.args: 78 » » » » msg += ' ' + arg 79 » return msg Traceback: 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 ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 339, in _thread dn = module.create( properties, container = options.get( 'container' ), superordinate = options.get( 'superordinate' ) ) 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 353, in create raise UDM_Error( get_exception_msg(e), obj.dn ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 78, in get_exception_msg msg += ' ' + arg TypeError: cannot concatenate 'str' and 'objectExists' objects Remark: Ubuntu Desktop als Maschine geadded (Versucht) The function also exists in UCS@school (copied, see Bug #30088). See also Bug #30089.
Created attachment 6484 [details] patch for one problem The first problem is that the exception is raised wrong. First argument should be string.
Created attachment 6485 [details] patch for all 4 problems patch which fixes: * move get_exception_msg into base.__str__ * make base.__str__ error prone * remove the usage of get_exception_msg in UDM * remove the usage of get_exception_msg in UCS@school
The function (which is now located in univention.admin.uexceptions.base.__str__()) cannot raise any exception anymore. It uses string interpolation for the argument and convert unicode to bytestrings. Fix: svn r56399 Package: univention-directory-manager-modules (10.0.29-5) YAML: 2014-11-28-univention-directory-manager-modules.yaml Downgradeable to UCS 3.2-4: possible Reproducing: >>> from univention.admin.uexceptions import base >>> str(base(1,2,3)) >>> from univention.management.console.modules.udm.udm_ldap import get_exception_msg >>> get_exception_msg(base(1,2,3))
OK, function removed, no problems encountered. The function was somewhat public (in that it did not start with _), but I guess this is okay.
http://errata.univention.de/ucs/4.0/18.html
Reported again, 3.2-4 errata277 (Borgfeld). Remark: Anlegen eines IP-Managed-Cleints