@@ -20,29 +20,28 @@ class ScyllaContainer(DockerContainer):
20
20
... "CREATE KEYSPACE keyspace1 WITH replication "
21
21
... "= {'class': 'SimpleStrategy', 'replication_factor': '1'};")
22
22
"""
23
- def __init__ (self , image = "scylladb/scylla:latest" , ports_to_expose = [9042 ]):
24
- super (ScyllaContainer , self ).__init__ (image )
23
+
24
+ def __init__ (self , image = "scylladb/scylla:latest" , ports_to_expose = (9042 ,)):
25
+ super ().__init__ (image )
25
26
self .ports_to_expose = ports_to_expose
26
27
self .with_exposed_ports (* self .ports_to_expose )
27
28
self .with_command ("--skip-wait-for-gossip-to-settle=0" )
28
29
29
30
@wait_container_is_ready ()
30
31
def _connect (self ):
31
- wait_for_logs (
32
- self ,
33
- predicate = "Starting listening for CQL clients" ,
34
- timeout = MAX_TRIES )
32
+ wait_for_logs (self , predicate = "Starting listening for CQL clients" , timeout = MAX_TRIES )
35
33
cluster = self .get_cluster ()
36
34
cluster .connect ()
37
35
38
36
def start (self ):
39
- super (ScyllaContainer , self ).start ()
37
+ super ().start ()
40
38
self ._connect ()
41
39
return self
42
40
43
41
def get_cluster (self , ** kwargs ):
44
42
from cassandra .cluster import Cluster
43
+
45
44
container = self .get_wrapped_container ()
46
45
container .reload ()
47
- hostname = container .attrs [' NetworkSettings' ][ ' IPAddress' ]
46
+ hostname = container .attrs [" NetworkSettings" ][ " IPAddress" ]
48
47
return Cluster (contact_points = [hostname ], ** kwargs )
0 commit comments