From 3d06df66a7d027bfd4712326d7f2d6066197de6c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 30 Aug 2017 10:42:04 -0600 Subject: [PATCH] fix error message --- scripts/lib/CIME/case.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/lib/CIME/case.py b/scripts/lib/CIME/case.py index f1226ad8abc..0f688baacba 100644 --- a/scripts/lib/CIME/case.py +++ b/scripts/lib/CIME/case.py @@ -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