summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-03-24 09:31:28 +0100
committeralalazo <massimiliano.culpo@googlemail.com>2016-03-24 09:31:28 +0100
commitf095e619b985a9271ff96cd469086d4654edf489 (patch)
tree7896d875373a67cf65041bc677ce0404c327ae0a /lib
parentd93f2b335d5a5198b943cc6293a1d24d614c979b (diff)
downloadspack-f095e619b985a9271ff96cd469086d4654edf489.tar.gz
spack-f095e619b985a9271ff96cd469086d4654edf489.tar.bz2
spack-f095e619b985a9271ff96cd469086d4654edf489.tar.xz
spack-f095e619b985a9271ff96cd469086d4654edf489.zip
module files configuration : enable/disable logic is now positive
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/config.py2
-rw-r--r--lib/spack/spack/modules.py9
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py
index 6ef79c70b1..14e5aaf4fb 100644
--- a/lib/spack/spack/config.py
+++ b/lib/spack/spack/config.py
@@ -249,7 +249,7 @@ section_schemas = {
'default': {},
'additionalProperties': False,
'properties': {
- 'disable': {
+ 'enable': {
'type': 'array',
'default': [],
'items': {
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index d354c8bb71..6c32937c3c 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -57,13 +57,8 @@ __all__ = ['EnvModule', 'Dotkit', 'TclModule']
# Registry of all types of modules. Entries created by EnvModule's metaclass
module_types = {}
+CONFIGURATION = spack.config.get_config('modules')
-def read_configuration_file():
- f = spack.config.get_config('modules')
- f.setdefault('disable', []) # Default : disable nothing
- return f
-
-CONFIGURATION = read_configuration_file()
def print_help():
"""For use by commands to tell user how to activate shell support."""
@@ -123,7 +118,7 @@ class EnvModule(object):
class __metaclass__(type):
def __init__(cls, name, bases, dict):
type.__init__(cls, name, bases, dict)
- if cls.name != 'env_module' and cls.name not in CONFIGURATION['disable']:
+ if cls.name != 'env_module' and cls.name in CONFIGURATION['enable']:
module_types[cls.name] = cls
def __init__(self, spec=None):