From 94e7e6f5f4dbe3c8f819bb72a15bb53529c4fd52 Mon Sep 17 00:00:00 2001 From: favilo Date: Fri, 28 Jun 2024 11:16:17 -0700 Subject: [PATCH] Fix issue pointed out by @AI-IshanBhatt Also revert naked `raise` back to `SystemSetupError`. I'd only done that for debugging purposes --- esrally/mechanic/team.py | 6 +----- esrally/utils/modules.py | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/esrally/mechanic/team.py b/esrally/mechanic/team.py index e12af2400..5309c5870 100644 --- a/esrally/mechanic/team.py +++ b/esrally/mechanic/team.py @@ -71,9 +71,6 @@ def __init__(self, root_path, entry_point): if BootstrapHookHandler(Component(root_path=p, entry_point=Car.entry_point)).can_load(): if p not in root_paths: root_paths.append(p) - # multiple cars are based on the same hook - # elif root_paths != p: - # raise exceptions.SystemSetupError(f"Invalid car: {name}. Multiple bootstrap hooks are forbidden.") all_config_base_vars.update(descriptor.config_base_variables) all_car_vars.update(descriptor.variables) @@ -518,8 +515,7 @@ def load(self): except BaseException: msg = f"Could not load bootstrap hooks in [{self.loader.root_path}]" self.logger.exception(msg) - raise - # raise exceptions.SystemSetupError(msg) + raise exceptions.SystemSetupError(msg) def register(self, phase, hook): self.logger.info("Registering bootstrap hook [%s] for phase [%s] in component [%s]", hook.__name__, phase, self.component.name) diff --git a/esrally/utils/modules.py b/esrally/utils/modules.py index b0396becb..a6bf537ee 100644 --- a/esrally/utils/modules.py +++ b/esrally/utils/modules.py @@ -111,7 +111,6 @@ def load(self) -> Collection[ModuleType]: component_root_path = os.path.abspath(os.path.join(root_path, os.pardir)) self.logger.debug("Adding [%s] to Python load path.", component_root_path) # needs to be at the beginning of the system path, otherwise import machinery tries to load application-internal modules - sys.path.insert(0, component_root_path) try: root_module = self._load_component(component_name, module_dirs, root_path) root_modules.append(root_module)