]> 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)
committerGilles DAVID <gilles-g.david@edf.fr>
Wed, 22 Mar 2023 08:21:38 +0000 (09:21 +0100)
try-load allows to have conflictual modules without failure.
The last module will be loaded.

bin/salomeContext.py

index 865b17557abc54b1e0a99e7c14d1d45546fa33ae..e3a9166833a30f8610ec3e0ffba76ae8d3152f1e 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))