diff --git a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/__init__.py b/ucs-4.0-0/base/univention-system-setup/umc/python/setup/__init__.py index 88b1109..a8c7547 100644 --- a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/__init__.py +++ b/ucs-4.0-0/base/univention-system-setup/umc/python/setup/__init__.py @@ -190,8 +190,14 @@ class Instance(Base, ProgressMixin): MODULE.info('Restart servers: %s' % restart) # on a joined system or on a basesystem, we can run the setup scripts - MODULE.info('runnning system setup scripts') - util.run_scripts( self._progressParser, restart ) + MODULE.info('runnning system setup scripts (flavor %r)' % (request.flavor,)) + subfolders = { + 'network': ['30_net'], + 'certificate': ['40_ssl'], + 'languages': ['15_keyboard', '20_language', '35_timezone'], + }.get(request.flavor) + + util.run_scripts(self._progressParser, restart, subfolders) # done :) self._finishedResult = True diff --git a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/util.py b/ucs-4.0-0/base/univention-system-setup/umc/python/setup/util.py index 95ea93f..0a02474 100644 --- a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/util.py +++ b/ucs-4.0-0/base/univention-system-setup/umc/python/setup/util.py @@ -409,14 +409,16 @@ class ProgressParser( object ): return False -def sorted_files_in_subdirs( directory ): +def sorted_files_in_subdirs(directory, allowed_subdirs=None): for entry in sorted(os.listdir(directory)): + if allowed_subdirs and entry not in allowed_subdirs: + continue path = os.path.join(directory, entry) if os.path.isdir(path): for filename in sorted(os.listdir(path)): yield os.path.join(path, filename) -def run_scripts( progressParser, restartServer = False ): +def run_scripts(progressParser, restartServer=False, allowed_subdirs=None): # write header before executing scripts f = open(LOG_FILE, 'a') f.write('\n\n=== RUNNING SETUP SCRIPTS (%s) ===\n\n' % timestamp()) @@ -435,7 +437,7 @@ def run_scripts( progressParser, restartServer = False ): # make sure that UMC servers and apache will not be restartet subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f ) - for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ): + for scriptpath in sorted_files_in_subdirs(PATH_SETUP_SCRIPTS, allowed_subdirs): # launch script MODULE.info('Running script %s\n' % scriptpath) p = subprocess.Popen( scriptpath, stdout = f, stderr = subprocess.STDOUT )