Skip to content

Commit a8f01e0

Browse files
committed
deafult to disable_shardaware_port=False when using scylla_cloud
Since we are going to work via a loadbalancer, shardaware base on port can't work for us. also if some would try to enable it via configuration, we'll fail like this: ``` Traceback (most recent call last): File "../python-driver/cloud_config.py", line 59, in <module> thread1() File "../python-driver/cloud_config.py", line 39, in thread1 cluster = Cluster(scylla_cloud='../config_data.yaml', connect_timeout=60, control_connection_timeout=30, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "../python-driver/cassandra/cluster.py", line 1167, in __init__ raise ValueError("shard_aware_options.disable_shardaware_port=False " ValueError: shard_aware_options.disable_shardaware_port=False cannot be specified with a scylla cloud configuration ``` Fixes: scylladb/scylla-operator#1104
1 parent a444188 commit a8f01e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cassandra/cluster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,9 @@ def __init__(self,
11631163
if contact_points is not _NOT_SET or ssl_context or ssl_options:
11641164
raise ValueError("contact_points, ssl_context, and ssl_options "
11651165
"cannot be specified with a scylla cloud configuration")
1166-
1166+
if shard_aware_options and not shard_aware_options.disable_shardaware_port:
1167+
raise ValueError("shard_aware_options.disable_shardaware_port=False "
1168+
"cannot be specified with a scylla cloud configuration")
11671169
uses_twisted = TwistedConnection and issubclass(self.connection_class, TwistedConnection)
11681170
uses_eventlet = EventletConnection and issubclass(self.connection_class, EventletConnection)
11691171

@@ -1174,6 +1176,7 @@ def __init__(self,
11741176
contact_points = scylla_cloud_config.contact_points
11751177
ssl_options = scylla_cloud_config.ssl_options
11761178
auth_provider = scylla_cloud_config.auth_provider
1179+
shard_aware_options = ShardAwareOptions(shard_aware_options, disable_shardaware_port=True)
11771180

11781181
if cloud is not None:
11791182
self.cloud = cloud

0 commit comments

Comments
 (0)