tcl module template: automatically unload automatically loaded modules (#32853)
Remove `module-info mode load` condition that prevents auto-unloading when autoloading is enabled. It looks like this condition was added to work around an issue in environment-modules that is no longer necessary. Add quotes to make is-loaded happy
This commit is contained in:
		| @@ -113,7 +113,7 @@ def test_alter_environment(self, modulefile_content, module_configuration, confi | |||||||
|         assert len([x for x in content if x.startswith("prepend-path CMAKE_PREFIX_PATH")]) == 0 |         assert len([x for x in content if x.startswith("prepend-path CMAKE_PREFIX_PATH")]) == 0 | ||||||
|         assert len([x for x in content if 'setenv FOO "foo"' in x]) == 0 |         assert len([x for x in content if 'setenv FOO "foo"' in x]) == 0 | ||||||
|         assert len([x for x in content if "unsetenv BAR" in x]) == 0 |         assert len([x for x in content if "unsetenv BAR" in x]) == 0 | ||||||
|         assert len([x for x in content if "is-loaded foo/bar" in x]) == 1 |         assert len([x for x in content if "is-loaded 'foo/bar'" in x]) == 1 | ||||||
|         assert len([x for x in content if "module load foo/bar" in x]) == 1 |         assert len([x for x in content if "module load foo/bar" in x]) == 1 | ||||||
|         assert len([x for x in content if "setenv LIBDWARF_ROOT" in x]) == 1 |         assert len([x for x in content if "setenv LIBDWARF_ROOT" in x]) == 1 | ||||||
| 
 | 
 | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ proc ModulesHelp { } { | |||||||
|  |  | ||||||
| {% block autoloads %} | {% block autoloads %} | ||||||
| {% for module in autoload %} | {% for module in autoload %} | ||||||
| if {{ '{' }} [ module-info mode load ] && ![ is-loaded {{ module }} ] {{ '}' }} {{ '{' }} | if {{ '{' }} ![ is-loaded '{{ module }}' ] {{ '}' }} {{ '{' }} | ||||||
| {% if verbose %} | {% if verbose %} | ||||||
|     puts stderr "Autoloading {{ module }}" |     puts stderr "Autoloading {{ module }}" | ||||||
| {% endif %} | {% endif %} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sergey Kosukhin
					Sergey Kosukhin