From: Gilles DAVID Date: Mon, 13 Mar 2023 18:21:55 +0000 (+0100) Subject: Use module try-load do get environnement from lmod modules X-Git-Tag: emc2p_1.3.7-rc1~1^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d4e5f5b4943697e526705923bdb3c02510e65bac;p=modules%2Fkernel.git Use module try-load do get environnement from lmod modules try-load allows to have conflictual modules without failure. The last module will be loaded. --- diff --git a/bin/salomeContext.py b/bin/salomeContext.py index 865b17557..e3a916683 100755 --- a/bin/salomeContext.py +++ b/bin/salomeContext.py @@ -111,7 +111,7 @@ class SalomeContext: raise SalomeContextException("Module environment not present") return try: - out, err = subprocess.Popen([modulecmd, "python", "load"] + env_modules, stdout=subprocess.PIPE).communicate() + out, err = subprocess.Popen([modulecmd, "python", "try-load"] + env_modules, stdout=subprocess.PIPE).communicate() exec(out) # define specific environment variables except Exception: raise SalomeContextException("Failed to load env modules: %s ..." % ' '.join(env_modules))