summaryrefslogtreecommitdiff
path: root/buildscripts/moduleconfig.py
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /buildscripts/moduleconfig.py
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'buildscripts/moduleconfig.py')
-rw-r--r--buildscripts/moduleconfig.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/buildscripts/moduleconfig.py b/buildscripts/moduleconfig.py
index b4d0bba0490..b31a9dbf8db 100644
--- a/buildscripts/moduleconfig.py
+++ b/buildscripts/moduleconfig.py
@@ -33,26 +33,16 @@ import os
def discover_modules(module_root, allowed_modules):
- # pylint: disable=too-many-branches
"""Scan module_root for subdirectories that look like MongoDB modules.
Return a list of imported build.py module objects.
"""
found_modules = []
- found_module_names = []
if allowed_modules is not None:
allowed_modules = allowed_modules.split(',')
- # When `--modules=` is passed, the split on empty string is represented
- # in memory as ['']
- if allowed_modules == ['']:
- allowed_modules = []
if not os.path.isdir(module_root):
- if allowed_modules:
- raise RuntimeError(
- f"Requested the following modules: {allowed_modules}, but the module root '{module_root}' could not be found. Check the module root, or remove the module from the scons invocation."
- )
return found_modules
for name in os.listdir(module_root):
@@ -76,17 +66,11 @@ def discover_modules(module_root, allowed_modules):
if getattr(module, "name", None) is None:
module.name = name
found_modules.append(module)
- found_module_names.append(name)
finally:
fp.close()
except (FileNotFoundError, IOError):
pass
- if allowed_modules is not None:
- missing_modules = set(allowed_modules) - set(found_module_names)
- if missing_modules:
- raise RuntimeError(f"Failed to locate all modules. Could not find: {missing_modules}")
-
return found_modules