Skip to content

Commit

Permalink
Merge pull request #473 from payu-org/dougiesquire/issue472-cesmcmeps…
Browse files Browse the repository at this point in the history
…-restart

CesmCmeps: check work_restart_path exists before trying to archive it
  • Loading branch information
dougiesquire authored Aug 2, 2024
2 parents 89d70cf + edbf34a commit c83489e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions payu/models/cesm_cmeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,12 @@ def archive(self):
shutil.move(f_src, f_dst)

# Archive any additional restarts in work_restart_path
for name in os.listdir(self.work_restart_path):
f_src = os.path.join(self.work_restart_path, name)
f_dst = os.path.join(self.restart_path, name)
shutil.move(f_src, f_dst)
os.rmdir(self.work_restart_path)
if os.path.exists(self.work_restart_path):
for name in os.listdir(self.work_restart_path):
f_src = os.path.join(self.work_restart_path, name)
f_dst = os.path.join(self.restart_path, name)
shutil.move(f_src, f_dst)
os.rmdir(self.work_restart_path)

def collate(self):

Expand Down

0 comments on commit c83489e

Please sign in to comment.