Skip to content

Commit

Permalink
Issue #743: Make show noSuchModule return an LmodError instead of Lmo…
Browse files Browse the repository at this point in the history
…dWarning
  • Loading branch information
Robert McLay committed Jan 9, 2025
1 parent 04bfb34 commit 6c00a62
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
14 changes: 7 additions & 7 deletions messageDir/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ Please check the spelling or version number. Also try "module spider ..."
Also make sure that all modulefiles written in TCL start with the string #%Module
]==],

e_Failed_2_Find_w_Access = [==[Failed to find the following module(s): "%{quote_comma_list}" in your MODULEPATH
Try:
$ module spider %{module_list}
to see if the module(s) are available across all compilers and MPI implementations.
]==],
e_Family_Conflict = [==[You can only have one %{name} module loaded at a time.
You already have %{oldName} loaded.
To correct the situation, please execute the following command:
Expand Down Expand Up @@ -317,13 +324,6 @@ No change in modules loaded.
]==],
w_Broken_FullName = "Badly formed module-version line: module-name must be fully qualified: %{fullName} is not.\n",
w_Empty_Coll = "You have no modules loaded because the collection \"%{collectionName}\" is empty!\n",
w_Failed_2_Find = [==[Failed to find the following module(s): "%{quote_comma_list}" in your MODULEPATH
Try:
$ module spider %{module_list}
to see if the module(s) are available across all compilers and MPI implementations.
]==],
w_MissingModules = [==[
%{border}
The following dependent module(s) are not currently loaded: %{missing}
Expand Down
4 changes: 2 additions & 2 deletions rt/show/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.37 2024-03-17 13:11 -06:00
Modules based on Lua: Version 8.7.55 2024-12-13 12:24 -07:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -97,7 +97,7 @@ os.exit("1")
step 13
lua ProjectDIR/src/lmod.in.lua shell --regression_testing show nosuchmodule
===========================
Lmod Warning: Failed to find the following module(s): "nosuchmodule" in your MODULEPATH
Lmod has detected the following error: Failed to find the following module(s): "nosuchmodule" in your MODULEPATH
Try:
$ module spider nosuchmodule
to see if the module(s) are available across all compilers and MPI implementations.
Expand Down
5 changes: 1 addition & 4 deletions rt/show/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ export _ModuleTable_;
step 13
lua ProjectDIR/src/lmod.in.lua shell --regression_testing show nosuchmodule
===========================
MODULEPATH=ProjectDIR/rt/show/mf/Core2:ProjectDIR/rt/show/mf/Core;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={boost={fn="ProjectDIR/rt/show/mf/Core/boost/1.47.1.lua",fullName="boost/1.47.1",loadOrder=1,propT={},stackDepth=0,status="active",userName="boost/1.47.1",wV="000000001.000000047.000000001.*zfinal",},},mpathA={"ProjectDIR/rt/show/mf/Core2","ProjectDIR/rt/show/mf/Core",},systemBaseMPATH="ProjectDIR/rt/show/mf/Core",}';
export _ModuleTable_;
false
===========================
step 14
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --location show a
Expand Down
4 changes: 2 additions & 2 deletions src/Hub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ function M.access(self, ...)


if (#a > 0) then
LmodWarning{msg="w_Failed_2_Find",quote_comma_list=concatTbl(a,"\", \""),
module_list=concatTbl(a," ")}
LmodError{msg="e_Failed_2_Find_w_Access",quote_comma_list=concatTbl(a,"\", \""),
module_list=concatTbl(a," ")}
end
dbg.fini("Hub:access")
end
Expand Down

0 comments on commit 6c00a62

Please sign in to comment.