Skip to content

Commit

Permalink
add support for new ccs_config structure - backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 13, 2024
1 parent bfa117f commit 72e3a75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CIME/XML/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def __init__(
if infile is None:
infile = files.get_value("BATCH_SPEC_FILE")

config_dir = os.path.dirname(infile)

schema = files.get_schema("BATCH_SPEC_FILE")

GenericXML.__init__(self, infile, schema=schema)
Expand All @@ -50,12 +52,20 @@ def __init__(
#
# This could cause problems if node matches are repeated when only one is expected.
infile = os.path.join(os.environ.get("HOME"), ".cime", "config_batch.xml")
usehome = False
if os.path.exists(infile):
GenericXML.read(self, infile)
usehome = True
useextra = False
if extra_machines_dir:
infile = os.path.join(extra_machines_dir, "config_batch.xml")
if os.path.exists(infile):
GenericXML.read(self, infile)
useextra = True
if not usehome and not useextra:
batchfile = os.path.join(config_dir, self.machine, "config_batch.xml")
if os.path.exists(batchfile):
GenericXML.read(self, batchfile)

if self.batch_system is not None:
self.set_batch_system(self.batch_system, machine=machine)
Expand Down

0 comments on commit 72e3a75

Please sign in to comment.