Skip to content

Commit

Permalink
Merge pull request #4411 from jedwards4b/exeroot_not_caseroot
Browse files Browse the repository at this point in the history
do not allow EXEROOT or OBJDIR or LIBROOT to be CASEROOT
  • Loading branch information
jedwards4b authored Aug 1, 2023
2 parents c6dd05d + 94207b3 commit f14a104
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CIME/XML/env_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@ def __init__(
initialize an object interface to file env_build.xml in the case directory
"""
schema = os.path.join(utils.get_schema_path(), "env_entry_id.xsd")
self._caseroot = case_root
EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)

def set_value(self, vid, value, subgroup=None, ignore_type=False):
"""
Set the value of an entry-id field to value
Returns the value or None if not found
subgroup is ignored in the general routine and applied in specific methods
"""
# Do not allow any of these to be the same as CASEROOT
if vid in ("EXEROOT", "OBJDIR", "LIBROOT"):
utils.expect(value != self._caseroot, f"Cannot set {vid} to CASEROOT")

return super(EnvBuild, self).set_value(
vid, value, subgroup=subgroup, ignore_type=ignore_type
)

0 comments on commit f14a104

Please sign in to comment.