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

use of getenv on display mode leads to error #422

Closed
xdelaruelle opened this issue Oct 11, 2021 · 2 comments
Closed

use of getenv on display mode leads to error #422

xdelaruelle opened this issue Oct 11, 2021 · 2 comments
Milestone

Comments

@xdelaruelle
Copy link
Member

Some use case of the getenv modulefile command:

set _modules_home [getenv MODULESHOME]
source ${_modules_home}/common

Leads to error when displaying modulefile:

$ module display mod
-------------------------------------------------------------------
/path/to/mod:

Module ERROR: couldn't read file "$MODULESHOME/common": no such file or directory
       while executing
   "source  "${_modules_home}/common"
       (file "/path/to/mod" line 8)
   Please contact <root@localhost>
-------------------------------------------------------------------

On display mode, getenv returns the variable name which leads to such error as the value is expected to fully resolve string value.

@xdelaruelle xdelaruelle added this to the 5.1 milestone Oct 11, 2021
@xdelaruelle
Copy link
Member Author

xdelaruelle commented Oct 11, 2021

To fix this issue, a --return-value option should be added to the getenv modulefile command to indicate that the value should be returned even on display evaluation mode.

@xdelaruelle
Copy link
Member Author

Same --return-value option should also apply to the getvariant modulefile command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant