module files configuration : enable/disable logic is now positive

This commit is contained in:
alalazo 2016-03-24 09:31:28 +01:00
parent d93f2b335d
commit f095e619b9
2 changed files with 3 additions and 8 deletions

View file

@ -249,7 +249,7 @@
'default': {},
'additionalProperties': False,
'properties': {
'disable': {
'enable': {
'type': 'array',
'default': [],
'items': {

View file

@ -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):