From f095e619b985a9271ff96cd469086d4654edf489 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 24 Mar 2016 09:31:28 +0100 Subject: [PATCH] module files configuration : enable/disable logic is now positive --- lib/spack/spack/config.py | 2 +- lib/spack/spack/modules.py | 9 ++------- 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 @@ '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 @@ # 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):