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 ) |