Skip to content

Commit

Permalink
Merge pull request #4727 from jedwards4b/improved_reselience
Browse files Browse the repository at this point in the history
add try except clauses to reduce errors in testing
  • Loading branch information
jedwards4b authored Jan 6, 2025
2 parents ef81824 + 11f3b30 commit cdf76d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CIME/case/case_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def case_run(self, skip_pnl=False, set_continue_run=False, submit_resubmits=Fals

# get the most recent cpl restart pointer file
rundir = self.get_value("RUNDIR")
if drv_restart_pointer:
if drv_restart_pointer and not self._read_only_mode:
pattern = os.path.join(rundir, "rpointer.cpl*")
files = sorted(glob.glob(pattern), key=os.path.getmtime)
if files:
Expand Down
10 changes: 8 additions & 2 deletions CIME/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ def append_case_status(phase, status, msg=None, caseroot=".", gitinterface=None)
logger.debug("adding file {}".format(f))
gitinterface.git_operation("add", f)
msg = msg if msg else " no message provided"
gitinterface.git_operation("commit", "-m", '"' + msg + '"')
push = True
try:
gitinterface.git_operation("commit", "-m", '"' + msg + '"')
except Exception as e:
print(e)
push = False

remote = gitinterface.git_operation("remote")
if remote:
if remote and push:
with Timeout(30):
gitinterface.git_operation("push", remote)

Expand Down

0 comments on commit cdf76d6

Please sign in to comment.