|
6 | 6 | import os |
7 | 7 | import sys |
8 | 8 | import logging |
9 | | -import subprocess |
10 | 9 | from CIME.SystemTests.system_tests_common import SystemTestsCommon |
11 | 10 | from CIME.XML.standard_module_setup import * |
12 | 11 |
|
13 | 12 | _CTSM_PYTHON = os.path.join( |
14 | 13 | os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "python" |
15 | 14 | ) |
16 | 15 | sys.path.insert(1, _CTSM_PYTHON) |
17 | | -from ctsm.subset_data import ( |
| 16 | +from ctsm.subset_data import ( # pylint: disable=wrong-import-position |
18 | 17 | main as subset_data, |
19 | | -) # pylint: disable=wrong-import-position |
| 18 | +) |
20 | 19 |
|
21 | 20 | logger = logging.getLogger(__name__) |
22 | 21 |
|
@@ -65,23 +64,5 @@ def build_phase(self, sharedlib_only=False, model_only=False): |
65 | 64 | ] |
66 | 65 | subset_data() |
67 | 66 |
|
68 | | - # Append files in usermods_dir to equivalents in top level of case |
69 | | - for file in os.listdir(usermods_dir): |
70 | | - # Get the full path to source and destination files |
71 | | - source_file_path = os.path.join(usermods_dir, file) |
72 | | - dest_file_path = os.path.join(self._get_caseroot(), file) |
73 | | - |
74 | | - # Read the content of the source file |
75 | | - with open(source_file_path, "r", encoding="utf-8") as source_file: |
76 | | - content_to_append = source_file.read() |
77 | | - |
78 | | - # Append the content to the destination file |
79 | | - with open(dest_file_path, "a", encoding="utf-8") as dest_file: |
80 | | - dest_file.write("\n\n\n" + content_to_append) |
81 | | - |
82 | | - # Run the generated shell_commands |
83 | | - if file == "shell_commands": |
84 | | - cmd = f"chmod +x {source_file_path}; {source_file_path}" |
85 | | - subprocess.check_call(cmd, shell=True) |
86 | | - |
| 67 | + self._case.apply_user_mods([usermods_dir]) |
87 | 68 | super().build_phase(sharedlib_only, model_only) |
0 commit comments