Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Kuhnke <[email protected]>
  • Loading branch information
tkilias and ckunki authored Jan 25, 2024
1 parent 67f5889 commit 7aef92b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exasol/current_container_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ def __init__(
def current_container(self) -> Optional[Container]:
ips = self._ip_retriever.ips()
ip_addresses = {ip.ip for ip in ips}
current_container_candidates = {
candidates = {
container
for container in self._docker_client.containers.list()
for network in self.retrieve_networks_of_container(container)
if network["IPAddress"] in ip_addresses
}
if len(current_container_candidates) == 1:
if len(candidates) == 1:
return next(iter(current_container_candidates))
elif len(current_container_candidates) == 0:
elif len(candidates) == 0:
return None
else:
raise RuntimeError(
Expand Down

0 comments on commit 7aef92b

Please sign in to comment.