Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsnastins committed Jul 16, 2024
1 parent d27911f commit 64b5e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/tomodachi_testcontainers/containers/common/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ def log_message_on_container_start(self) -> str:
"""Returns a message that will be logged when the container starts."""

def get_container_host_ip(self) -> str:
host = self.get_docker_client().host()
if not host:
if not (host := self.get_docker_client().host()):
return "localhost"
if inside_container() and not os.getenv("DOCKER_HOST"):
gateway_ip = self.get_container_gateway_ip()
if gateway_ip == host:
if (gateway_ip := self.get_container_gateway_ip()) == host:
return self.get_container_internal_ip()
return gateway_ip
return host
Expand Down
2 changes: 1 addition & 1 deletion src/tomodachi_testcontainers/containers/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_external_known_host(self) -> str:

def get_known_hosts(self) -> asyncssh.SSHKnownHosts:
known_hosts = asyncssh.SSHKnownHosts()
for known_host in [self.get_internal_known_host(), self.get_external_known_host()]:
for known_host in (self.get_internal_known_host(), self.get_external_known_host()):
known_hosts.load(known_host)
return known_hosts

Expand Down

0 comments on commit 64b5e84

Please sign in to comment.