Skip to content

Commit

Permalink
Merge pull request #1850 from jedwards4b/fix_error_message
Browse files Browse the repository at this point in the history
fix error message

Do not print message about leaving case directory if the directory was never created

Test suite: hand tests of create_newcase
Test baseline:
Test namelist changes:
Test status: bit for bit
Fixes #1824

User interface changes?:

Update gh-pages html (Y/N)?:

Code review:
  • Loading branch information
jgfouca authored Aug 30, 2017
2 parents dd04e87 + 3d06df6 commit 0b8afd9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/lib/CIME/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,10 +1472,11 @@ def create(self, casename, srcroot, compset_name, grid_name, user_mods_dir=None,
# Lock env_case.xml
lock_file("env_case.xml", self._caseroot)
except:
if os.path.exists(self._caseroot) and not logger.isEnabledFor(logging.DEBUG) and not test:
logger.warn("Failed to setup case, removing {}\nUse --debug to force me to keep caseroot".format(self._caseroot))
shutil.rmtree(self._caseroot)
else:
logger.warn("Leaving broken case dir {}".format(self._caseroot))
if os.path.exists(self._caseroot):
if not logger.isEnabledFor(logging.DEBUG) and not test:
logger.warn("Failed to setup case, removing {}\nUse --debug to force me to keep caseroot".format(self._caseroot))
shutil.rmtree(self._caseroot)
else:
logger.warn("Leaving broken case dir {}".format(self._caseroot))

raise

0 comments on commit 0b8afd9

Please sign in to comment.