Skip to content

Commit

Permalink
Check for MODULESHOME environment variable for gadi support (#210)
Browse files Browse the repository at this point in the history
* Check for MODULESHOME environment variable for gadi support

* Changed default version
  • Loading branch information
aidanheerdegen committed Nov 19, 2019
1 parent 2fd7201 commit 96c88a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions payu/envmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
subprocess.check_output = check_output

DEFAULT_BASEPATH = '/opt/Modules'
DEFAULT_VERSION = '3.2.6'
DEFAULT_VERSION = 'v4.3.0'


def setup(basepath=DEFAULT_BASEPATH):
"""Set the environment modules used by the Environment Module system."""

module_version = os.environ.get('MODULE_VERSION', DEFAULT_VERSION)
moduleshome = os.path.join(basepath, module_version)

moduleshome = os.environ.get('MODULESHOME', None)

if moduleshome is None:
moduleshome = os.path.join(basepath, module_version)

# Abort if MODULESHOME does not exist
if not os.path.isdir(moduleshome):
Expand Down

0 comments on commit 96c88a0

Please sign in to comment.