Skip to content

Commit

Permalink
bless_test_results: hot fix to handle empty bless logs
Browse files Browse the repository at this point in the history
[BFB]
  • Loading branch information
jgfouca committed Aug 13, 2019
1 parent 0c41805 commit c06eaeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cime/scripts/lib/CIME/hist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,10 @@ def compare_baseline(case, baseline_dir=None, outfile_suffix=""):
if get_model() == "e3sm":
bless_log = os.path.join(basecmp_dir, BLESS_LOG_NAME)
if os.path.exists(bless_log):
last_line = open(bless_log, "r").readlines()[-1]
comments += "\n Most recent bless: {}".format(last_line)
lines = open(bless_log, "r").readlines()
if lines:
last_line = lines[-1]
comments += "\n Most recent bless: {}".format(last_line)

return success, comments

Expand Down

0 comments on commit c06eaeb

Please sign in to comment.