Skip to content

Commit

Permalink
Merge pull request #512 from jedwards4b/user_mods_path_fix
Browse files Browse the repository at this point in the history
This fixes a bug when the user_mods_path is unset in a case or a test

Test suite: scripts_regression_tests
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes #509

User interface changes?:

Code review: jayeshkrishna
  • Loading branch information
jayeshkrishna authored Sep 6, 2016
2 parents f21e864 + e4bbd32 commit 58e1f5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/python/CIME/user_mod_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ def build_include_dirs_list(user_mods_path, include_dirs=None):
each of those directories for further directories.
The file may also include comments deleneated with # in the first column
'''
include_dirs = [] if include_dirs is None else include_dirs
if user_mods_path is None or user_mods_path == 'UNSET':
return include_dirs
expect(os.path.isabs(user_mods_path),
"Expected full directory path, got '%s'"%user_mods_path)
expect(os.path.isdir(user_mods_path),
"Directory not found %s"%user_mods_path)
logger.info("Adding user mods directory %s"%user_mods_path)
include_dirs = [] if include_dirs is None else include_dirs
include_dirs.append(os.path.normpath(user_mods_path))
include_file = os.path.join(include_dirs[-1],"include_user_mods")
if os.path.isfile(include_file):
Expand Down

0 comments on commit 58e1f5b

Please sign in to comment.