[Script] Fixed a bug in task run when removing previous runs
This commit is contained in:
parent
be8f18310d
commit
2990eb7406
|
@ -190,22 +190,23 @@ def generate_each_task_actions(taskname):
|
||||||
clean_up_and_exit(
|
clean_up_and_exit(
|
||||||
"Missing configuration file for task %s" % curr_task_dir)
|
"Missing configuration file for task %s" % curr_task_dir)
|
||||||
|
|
||||||
# Create run directory for current task run ./runxxx
|
|
||||||
run_dirs = [int(os.path.basename(x)[-3:]) for x in glob.glob('run*[0-9]')]
|
|
||||||
curr_run_dir = "run%03d" % (max(run_dirs+[0, ])+1)
|
|
||||||
if args.remove_run_dir:
|
if args.remove_run_dir:
|
||||||
remove_run_dir()
|
remove_run_dir()
|
||||||
try:
|
else:
|
||||||
os.mkdir(curr_run_dir)
|
# Create run directory for current task run ./runxxx
|
||||||
if os.path.islink('latest') or os.path.exists('latest'):
|
run_dirs = [int(os.path.basename(x)[-3:]) for x in glob.glob('run*[0-9]')]
|
||||||
os.remove("latest")
|
curr_run_dir = "run%03d" % (max(run_dirs+[0, ])+1)
|
||||||
os.symlink(curr_run_dir, "latest")
|
try:
|
||||||
logger.info('Created "%s" directory for current task run' %
|
os.mkdir(curr_run_dir)
|
||||||
curr_run_dir)
|
if os.path.islink('latest') or os.path.exists('latest'):
|
||||||
except:
|
os.remove("latest")
|
||||||
logger.exception("")
|
os.symlink(curr_run_dir, "latest")
|
||||||
logger.error("Failed to create new run directory in task directory")
|
logger.info('Created "%s" directory for current task run' %
|
||||||
os.chdir(curr_run_dir)
|
curr_run_dir)
|
||||||
|
except:
|
||||||
|
logger.exception("")
|
||||||
|
logger.error("Failed to create new run directory in task directory")
|
||||||
|
os.chdir(curr_run_dir)
|
||||||
|
|
||||||
# Read task configuration file and check consistency
|
# Read task configuration file and check consistency
|
||||||
task_conf = ConfigParser(allow_no_value=True,
|
task_conf = ConfigParser(allow_no_value=True,
|
||||||
|
|
Loading…
Reference in New Issue