From d779689e7c5710bb276e82113352d6d8ac15f1b8 Mon Sep 17 00:00:00 2001 Message-Id: From: Philipp Hahn Date: Tue, 8 Oct 2013 10:58:49 +0200 Subject: [PATCH] Bug #32817: USS: Catch exception on script execution Organization: Univention GmbH, Bremen, Germany Catch OSError when executing the scripts, since otherwise the browser get stuck. --- .../base/univention-system-setup/umc/python/setup/util.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py index 0fcdee0..cc7fa45 100644 --- a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py +++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py @@ -133,7 +133,7 @@ def load_values(): def _xkeymap(keymap): '''Determine the x-keymap which belongs to 'keymap' by parsing /lib/univention-installer/locale/all-kmaps''' - + xkeymap = {'layout' : '', 'variant' : ''} fp = open('/lib/univention-installer/locale/all-kmaps', 'r') for line in fp: @@ -368,9 +368,13 @@ def run_scripts( progressParser, restartServer = False ): subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f ) for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ): - # launch script - MODULE.info('Running script %s\n' % scriptpath) + # launch script + try: p = subprocess.Popen( scriptpath, stdout = subprocess.PIPE, stderr = subprocess.STDOUT ) + MODULE.info("Running script '%s': pid=%d" % (scriptpath, p.pid)) + except OSError, ex: + MODULE.info("Failed to run '%s': %s" % (scriptpath, ex)) + else: for line in p.stdout: progressParser.parse( line ) f.write( line ) @@ -579,7 +583,7 @@ def get_components(role=None): # reload for correct locale imp.reload(package_list) - pkglist = [ jpackage for icategory in package_list.PackageList + pkglist = [ jpackage for icategory in package_list.PackageList for jpackage in icategory['Packages'] if 'all' in jpackage['Possible'] or role in jpackage['Possible'] ] -- 1.7.10.4