Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ModulesInfo when using Lmod #27

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions machinestate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2981,9 +2981,11 @@ def __init__(self, extended=False, anonymous=False, modulecmd="modulecmd"):
super(ModulesInfo, self).__init__(name="ModulesInfo",
extended=extended,
anonymous=anonymous)
if os.getenv("LMOD_CMD"):
modulecmd = os.getenv("LMOD_CMD")
self.modulecmd = modulecmd
parse = ModulesInfo.parsemodules
cmd_opts = "sh list -t 2>&1"
cmd_opts = "sh -t list 2>&1"
cmd = modulecmd
abspath = which(cmd)
if modulecmd is not None and len(modulecmd) > 0:
Expand All @@ -3001,8 +3003,10 @@ def __init__(self, extended=False, anonymous=False, modulecmd="modulecmd"):
self.addc("Loaded", abscmd, cmd_opts, None, parse)
@staticmethod
def parsemodules(value):
slist = re.split("\n", value)
return slist[1:]
slist = [ x for x in re.split("\n", value) if ";" not in x ]
if re.match("^Currently Loaded.+$", slist[0]):
slist = slist[1:]
return slist

################################################################################
# Infos about interrupt handling
Expand Down
Loading