Skip to content

Commit dbaff8d

Browse files
committed
Allow sanity checks using dangling symlinks
When doing short term archiving of model output allow sanity checks for files to support dangling symlinks. When archiving directories with symlinks (e.g. ADIOS BP files with symlinks to it) the directories can get archived before the symlinks. Allow sanity checks to pass even when the script finds these dangling symlinks.
1 parent 7cfd7ca commit dbaff8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CIME/case/case_st_archive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def _archive_restarts_date_comp(
644644
srcfile = os.path.join(rundir, histfile)
645645
destfile = os.path.join(archive_restdir, histfile)
646646
expect(
647-
os.path.exists(srcfile),
647+
os.path.exists(srcfile) or os.path.islink(srcfile),
648648
"history restart file {} for last date does not exist ".format(
649649
srcfile
650650
),
@@ -662,7 +662,7 @@ def _archive_restarts_date_comp(
662662
srcfile = os.path.join(rundir, rfile)
663663
destfile = os.path.join(archive_restdir, rfile)
664664
expect(
665-
os.path.exists(srcfile),
665+
os.path.exists(srcfile) or os.path.islink(srcfile),
666666
"restart file {} does not exist ".format(srcfile),
667667
)
668668
logger.info(
@@ -678,7 +678,7 @@ def _archive_restarts_date_comp(
678678
srcfile = os.path.join(rundir, histfile)
679679
destfile = os.path.join(archive_restdir, histfile)
680680
expect(
681-
os.path.exists(srcfile),
681+
os.path.exists(srcfile) or os.path.islink(srcfile),
682682
"hist file {} does not exist ".format(srcfile),
683683
)
684684
logger.info("copying {} to {}".format(srcfile, destfile))

0 commit comments

Comments
 (0)