Skip to content

Commit

Permalink
1. Fixed return type in spawn_test_database.py
Browse files Browse the repository at this point in the history
2. Fixed instantiation of SshInfo in spawn_test_database.py
  • Loading branch information
tomuben committed Nov 21, 2024
1 parent 40c8980 commit e5f57f8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from docker.models.containers import Container
from docker.models.volumes import Volume
from docker.client import DockerClient
from importlib_resources.abc import Traversable
from jinja2 import Template

from exasol_integration_test_docker_environment.lib import PACKAGE_NAME
Expand Down Expand Up @@ -200,7 +201,8 @@ def _create_database_info(self, db_ip_address: str, reused: bool) -> DatabaseInf
network_info=self.network_info,
volume_name=self._get_db_volume_name(),
)
ssh_info = SshInfo(self.ssh_user, self.ssh_key_file) # type: ignore
assert self.ssh_key_file
ssh_info = SshInfo(self.ssh_user, str(self.ssh_key_file))
database_info = DatabaseInfo(
host=db_ip_address,
ports=self.internal_ports,
Expand Down Expand Up @@ -304,7 +306,7 @@ def _prepare_volume(
)
return volume, container

def _db_file(self, filename: str) -> str:
def _db_file(self, filename: str) -> Traversable:
return (
importlib_resources.files(PACKAGE_NAME)
/ self.docker_db_config_resource_name
Expand All @@ -319,7 +321,7 @@ def _upload_init_db_files(
):
copy = DockerContainerCopy(container)
init_script = self._db_file("init_db.sh")
copy.add_string_to_file("init_db.sh", init_script.read_text()) # type: ignore
copy.add_string_to_file("init_db.sh", init_script.read_text())
self._add_exa_conf(copy, db_private_network, authorized_keys)
copy.copy("/")

Expand Down

0 comments on commit e5f57f8

Please sign in to comment.