#
def __loadEnvModules(self, env_modules):
- print("Trying to load env modules: %s ..." % ' '.join(env_modules))
modulecmd = os.getenv('LMOD_CMD')
if not modulecmd:
- print('Module environment not present')
+ raise SalomeContextException("Module environment not present")
return
try:
out, err = subprocess.Popen([modulecmd, "python", "load"] + env_modules, stdout=subprocess.PIPE).communicate()
exec(out) # define specific environment variables
- print("OK")
except:
- print("** Failed **")
+ raise SalomeContextException("Failed to load env modules: %s ..." % ' '.join(env_modules))
pass
#