Skip to content

Commit 1d33449

Browse files
committed
Exit early from sanity_check_load_module for extensions
1 parent 473c0a1 commit 1d33449

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

easybuild/framework/easyblock.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
from easybuild.tools.build_log import EasyBuildError, EasyBuildExit, dry_run_msg, dry_run_warning, dry_run_set_dirs
8686
from easybuild.tools.build_log import print_error_and_exit, print_msg, print_warning
8787
from easybuild.tools.config import CHECKSUM_PRIORITY_JSON, DEFAULT_ENVVAR_USERS_MODULES
88-
from easybuild.tools.config import EASYBUILD_SOURCES_URL, EBPYTHONPREFIXES # noqa
88+
from easybuild.tools.config import EASYBUILD_SOURCES_URL, EBPYTHONPREFIXES # noqa # pylint:disable=unused-import
8989
from easybuild.tools.config import FORCE_DOWNLOAD_ALL, FORCE_DOWNLOAD_PATCHES, FORCE_DOWNLOAD_SOURCES
9090
from easybuild.tools.config import MOD_SEARCH_PATH_HEADERS, PYTHONPATH, SEARCH_PATH_BIN_DIRS, SEARCH_PATH_LIB_DIRS
9191
from easybuild.tools.config import build_option, build_path, get_failed_install_build_dirs_path
@@ -4365,15 +4365,17 @@ def sanity_check_load_module(self, extension=None, extra_modules=None):
43654365
f'Should be: {self.is_extension}, got: {extension}')
43664366
del extension # Avoid accidental use
43674367

4368+
if self.is_extension:
4369+
return self.fake_mod_data
4370+
43684371
# skip loading of fake module when using --sanity-check-only, load real module instead
4369-
if build_option('sanity_check_only') and not extension:
4372+
if build_option('sanity_check_only'):
43704373
self.log.info("Loading real module for %s %s: %s", self.name, self.version, self.short_mod_name)
43714374
self.load_module(extra_modules=extra_modules)
43724375
self.sanity_check_module_loaded = True
43734376

43744377
# only load fake module for non-extensions, and not during dry run
4375-
elif not (extension or self.dry_run):
4376-
4378+
elif not self.dry_run:
43774379
if extra_modules:
43784380
self.log.info("Loading extra modules for sanity check: %s", ', '.join(extra_modules))
43794381

0 commit comments

Comments
 (0)