Skip to content

Commit

Permalink
Fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Nov 20, 2024
1 parent 7bc8cc3 commit ff0f0d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions exasol_integration_test_docker_environment/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
package and also provide help to find potential fixes.
"""
import sys
from typing import Iterable
from collections.abc import Callable
from typing import Iterable, List, Tuple
from exasol import error
from enum import Enum

Expand Down Expand Up @@ -78,11 +79,13 @@ def health_checkup() -> Iterable[error.ExaError]:
return an iterator of error codes specifying which problems have been identified.
"""
examinations = [
check_function = Callable[[],bool]
diagnosis_function = Callable[[],Iterable[error.ExaError]]
examinations : List[Tuple[check_function, diagnosis_function]] = [
(is_docker_daemon_available, diagnose_docker_daemon_not_available),
(is_supported_platform, lambda: Error.TargetPlatformNotSupported),
(is_supported_platform, lambda: [Error.TargetPlatformNotSupported]),
]
for is_fine, diagnosis in examinations:
if not is_fine():
for error_code in diagnosis(): # type: ignore
for error_code in diagnosis():
yield error_code
7 changes: 4 additions & 3 deletions exasol_integration_test_docker_environment/lib/api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ def import_build_steps(flavor_path: Tuple[str, ...]):
path_to_build_steps = Path(path).joinpath("flavor_base/build_steps.py")
module_name_for_build_steps = extract_modulename_for_build_steps(path)
spec = importlib.util.spec_from_file_location(module_name_for_build_steps, path_to_build_steps)
module = importlib.util.module_from_spec(spec) # type: ignore
spec.loader.exec_module(module) # type: ignore
assert spec and spec.loader
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)


def generate_root_task(task_class, *args, **kwargs) -> DependencyLoggerBaseTask:
Expand Down Expand Up @@ -178,7 +179,7 @@ def _configure_logging(
use_job_specific_log_file: bool) -> Iterator[Dict[str, str]]:
with get_luigi_log_config(log_file_target=log_file_path,
log_level=log_level,
use_job_specific_log_file=use_job_specific_log_file) as luigi_config: # type: Path
use_job_specific_log_file=use_job_specific_log_file) as luigi_config:
no_configure_logging, run_kwargs = _configure_logging_parameter(
log_level=log_level,
luigi_config=luigi_config,
Expand Down

0 comments on commit ff0f0d2

Please sign in to comment.