View | Details | Raw Unified | Return to bug 36939
Collapse All | Expand All

(-)a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/__init__.py (-2 / +8 lines)
 Lines 190-197   class Instance(Base, ProgressMixin): Link Here 
190
				MODULE.info('Restart servers: %s' % restart)
190
				MODULE.info('Restart servers: %s' % restart)
191
191
192
				# on a joined system or on a basesystem, we can run the setup scripts
192
				# on a joined system or on a basesystem, we can run the setup scripts
193
				MODULE.info('runnning system setup scripts')
193
				MODULE.info('runnning system setup scripts (flavor %r)' % (request.flavor,))
194
				util.run_scripts( self._progressParser, restart )
194
				subfolders = {
195
					'network': ['30_net'],
196
					'certificate': ['40_ssl'],
197
					'languages': ['15_keyboard', '20_language', '35_timezone'],
198
				}.get(request.flavor)
199
200
				util.run_scripts(self._progressParser, restart, subfolders)
195
201
196
				# done :)
202
				# done :)
197
				self._finishedResult = True
203
				self._finishedResult = True
(-)a/ucs-4.0-0/base/univention-system-setup/umc/python/setup/util.py (-3 / +5 lines)
 Lines 409-422   class ProgressParser( object ): Link Here 
409
409
410
		return False
410
		return False
411
411
412
def sorted_files_in_subdirs( directory ):
412
def sorted_files_in_subdirs(directory, allowed_subdirs=None):
413
	for entry in sorted(os.listdir(directory)):
413
	for entry in sorted(os.listdir(directory)):
414
		if allowed_subdirs and entry not in allowed_subdirs:
415
			continue
414
		path = os.path.join(directory, entry)
416
		path = os.path.join(directory, entry)
415
		if os.path.isdir(path):
417
		if os.path.isdir(path):
416
			for filename in sorted(os.listdir(path)):
418
			for filename in sorted(os.listdir(path)):
417
				yield os.path.join(path, filename)
419
				yield os.path.join(path, filename)
418
420
419
def run_scripts( progressParser, restartServer = False ):
421
def run_scripts(progressParser, restartServer=False, allowed_subdirs=None):
420
	# write header before executing scripts
422
	# write header before executing scripts
421
	f = open(LOG_FILE, 'a')
423
	f = open(LOG_FILE, 'a')
422
	f.write('\n\n=== RUNNING SETUP SCRIPTS (%s) ===\n\n' % timestamp())
424
	f.write('\n\n=== RUNNING SETUP SCRIPTS (%s) ===\n\n' % timestamp())
 Lines 435-441   def run_scripts( progressParser, restartServer = False ): Link Here 
435
	# make sure that UMC servers and apache will not be restartet
437
	# make sure that UMC servers and apache will not be restartet
436
	subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f )
438
	subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f )
437
439
438
	for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ):
440
	for scriptpath in sorted_files_in_subdirs(PATH_SETUP_SCRIPTS, allowed_subdirs):
439
			# launch script
441
			# launch script
440
			MODULE.info('Running script %s\n' % scriptpath)
442
			MODULE.info('Running script %s\n' % scriptpath)
441
			p = subprocess.Popen( scriptpath, stdout = f, stderr = subprocess.STDOUT )
443
			p = subprocess.Popen( scriptpath, stdout = f, stderr = subprocess.STDOUT )

Return to bug 36939