Repository: exasol/integration-test-docker-environment (language: python)

Issue:
Extract module name extraction into separate method
## Background

The module name extraction of build steps / flavors exists in 2 places, 

- in common.py => import_build_steps()
- and in script-languages-container-tools in DockerFlavorBuildBase.py.

## Acceptance Criteria

Move into new method and use in both places.


Discussion / hints:

Fix patch:
diff --git a/doc/changes/changes_0.8.0.md b/doc/changes/changes_0.8.0.md
index 9ca37492f..efc19eb4a 100644
--- a/doc/changes/changes_0.8.0.md
+++ b/doc/changes/changes_0.8.0.md
@@ -31,7 +31,7 @@ If you need further versions, please open an issue.
 
 ## Refactoring:
 
-n/a
+ - #141: Extract module name extraction into separate method
 
 ## Documentation:
 


Test patch:
diff --git a/exasol_integration_test_docker_environment/cli/common.py b/exasol_integration_test_docker_environment/cli/common.py
index b8aebcf51..fb4bbf4cf 100644
--- a/exasol_integration_test_docker_environment/cli/common.py
+++ b/exasol_integration_test_docker_environment/cli/common.py
@@ -10,6 +10,7 @@
 import networkx
 from networkx import DiGraph
 
+from exasol_integration_test_docker_environment.lib import extract_modulename_for_build_steps
 from exasol_integration_test_docker_environment.lib.base.dependency_logger_base_task import DependencyLoggerBaseTask
 from exasol_integration_test_docker_environment.lib.base.task_dependency import TaskDependency, DependencyState
 
@@ -71,7 +72,7 @@ def import_build_steps(flavor_path: Tuple[str, ...]):
     import importlib.util
     for path in flavor_path:
         path_to_build_steps = Path(path).joinpath("flavor_base/build_steps.py")
-        module_name_for_build_steps = path.replace("/", "_").replace(".", "_")
+        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)
         spec.loader.exec_module(module)
diff --git a/exasol_integration_test_docker_environment/lib/__init__.py b/exasol_integration_test_docker_environment/lib/__init__.py
index e69de29bb..ee3ca41af 100644
--- a/exasol_integration_test_docker_environment/lib/__init__.py
+++ b/exasol_integration_test_docker_environment/lib/__init__.py
@@ -0,0 +1,3 @@
+
+def extract_modulename_for_build_steps(path: str):
+    return path.replace("/", "_").replace(".", "_")