Skip to content

Commit 46913c1

Browse files
fix(scylla): scylla get cluster method (#778)
use convention for getting ip and port instead of hardcoding DIND mode
1 parent 7517297 commit 46913c1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

modules/scylla/testcontainers/scylla/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, image="scylladb/scylla:latest", ports_to_expose=(9042,)):
2727
self.with_exposed_ports(*self.ports_to_expose)
2828
self.with_command("--skip-wait-for-gossip-to-settle=0")
2929

30-
@wait_container_is_ready()
30+
@wait_container_is_ready(OSError)
3131
def _connect(self):
3232
wait_for_logs(self, predicate="Starting listening for CQL clients", timeout=MAX_TRIES)
3333
cluster = self.get_cluster()
@@ -41,7 +41,6 @@ def start(self):
4141
def get_cluster(self, **kwargs):
4242
from cassandra.cluster import Cluster
4343

44-
container = self.get_wrapped_container()
45-
container.reload()
46-
hostname = container.attrs["NetworkSettings"]["IPAddress"]
47-
return Cluster(contact_points=[hostname], **kwargs)
44+
hostname = self.get_container_host_ip()
45+
port = self.get_exposed_port(9042)
46+
return Cluster(contact_points=[hostname], port=port, **kwargs)

0 commit comments

Comments
 (0)