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.4.0-rc1~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8306d70519d0426fca4862042219799dfcfe4f38;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 605c9cd16..41bbb9d0b 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))