]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Use module try-load do get environnement from lmod modules
authorGilles DAVID <gilles-g.david@edf.fr>
Mon, 13 Mar 2023 18:21:55 +0000 (19:21 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 31 May 2023 14:39:07 +0000 (16:39 +0200)
try-load allows to have conflictual modules without failure.
The last module will be loaded.

bin/salomeContext.py

index 605c9cd16a2357b57f406606d94c230f48247ec9..41bbb9d0bdf89ba21a6fd443a8ebc1607cdc6933 100755 (executable)
@@ -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))