Skip to content

Commit 6ed0b70

Browse files
Jenkins CIopencontrail-ci-admin
authored andcommitted
Merge "config/cassandra: best-effort to support upgrade to cql driver"
2 parents 0b80eb7 + f218565 commit 6ed0b70

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/config/common/cfgm_common/datastore/drivers/cassandra_cql.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333

3434
DEFAULT_CQL_PORT = 9042
35+
DEFAULT_THRIFT_PORT = 9160
3536

3637
# Properties passed to the column familly
3738
TABLE_PROPERTIES = {
@@ -360,6 +361,18 @@ def _Init_Cluster(self):
360361
except ValueError:
361362
endpoints.append(address)
362363

364+
# Best-effort to support upgrade from thrift to cql
365+
if port == DEFAULT_THRIFT_PORT:
366+
self.options.logger(
367+
"Usage of thrift port '{}' detected for CQL driver. "
368+
"Please consider fixing port number. Trying "
369+
"best-effort by switching to default port for "
370+
"CQL '{}'.".format(
371+
DEFAULT_THRIFT_PORT,
372+
DEFAULT_CQL_PORT),
373+
level=SandeshLevel.SYS_WARN)
374+
port = None
375+
363376
connector.ProtocolVersion.SUPPORTED_VERSIONS = self.ProtocolVersions
364377
try:
365378
self._cluster = connector.cluster.Cluster(

0 commit comments

Comments
 (0)