Univention Bugzilla – Bug 39013
admin.modules.update() should handle ImportError
Last modified: 2019-05-03 10:07:35 CEST
Created attachment 7044 [details] patch If something fails in univention.admin.modules.update() nothing is possible anymore. UMC-webserver restart fails, udm-cli is broken, …. We could ignore import errors there so that failing handlers doesn't block the rest. The disadvantage could be that we don't recognize errors like Bug #39004. Attached is a patch. Here an example traceback: # service univention-management-console-web-server restart Restarting Univention Management Console Web Server. Traceback (most recent call last): File "/usr/sbin/univention-management-console-web-server", line 55, in <module> import univention.management.console.protocol as umcp File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/__init__.py", line 187, in <module> from session import * File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/session.py", line 72, in <module> udm_modules.update() File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 92, in update os.path.walk(dir, _walk, p) File "/usr/lib/python2.6/posixpath.py", line 236, in walk walk(name, func, arg) File "/usr/lib/python2.6/posixpath.py", line 228, in walk func(arg, top, names) File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 76, in _walk m=__import__(mod, globals(), locals(), name) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/__init__.py", line 46, in <module> os.path.walk( path, __walk, path ) File "/usr/lib/python2.6/posixpath.py", line 228, in walk func(arg, top, names) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/__init__.py", line 43, in __walk policies.append( __import__( file[ : -3 ], globals(), locals(), [ '' ] ) ) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/mailquota.py", line 40, in <module> from univention.admin.policy import ( ImportError: No module named policy done.
*** Bug 32589 has been marked as a duplicate of this bug. ***
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016. Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.