diff options
author | Mathias Stearn <mathias@10gen.com> | 2015-04-06 14:28:26 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2015-04-09 11:35:56 -0400 |
commit | a7fa0b96f58d22af7b074cb6a90d16c7b71a39f2 (patch) | |
tree | b3b9a9eae41e9bf5b04d9d3e53f1eb4ba9558c71 /buildscripts/moduleconfig.py | |
parent | 0b5c0fb6b79965c36639de2f02e4a3cb796d0cf5 (diff) | |
download | mongo-a7fa0b96f58d22af7b074cb6a90d16c7b71a39f2.tar.gz |
SERVER-17897 Add a way to opt out of building modules
Diffstat (limited to 'buildscripts/moduleconfig.py')
-rw-r--r-- | buildscripts/moduleconfig.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/buildscripts/moduleconfig.py b/buildscripts/moduleconfig.py index 5cf6c63afd7..111b49545e5 100644 --- a/buildscripts/moduleconfig.py +++ b/buildscripts/moduleconfig.py @@ -30,13 +30,16 @@ import imp import inspect import os -def discover_modules(module_root): +def discover_modules(module_root, allowed_modules): """Scans module_root for subdirectories that look like MongoDB modules. Returns a list of imported build.py module objects. """ found_modules = [] + if allowed_modules is not None: + allowed_modules = allowed_modules.split(',') + if not os.path.isdir(module_root): return found_modules @@ -48,6 +51,10 @@ def discover_modules(module_root): build_py = os.path.join(root, 'build.py') module = None + if allowed_modules is not None and name not in allowed_modules: + print "skipping module: %s" % name + continue + if os.path.isfile(build_py): print "adding module: %s" % name fp = open(build_py, "r") |