Probe system.local table to determine Cassandra and CQL version. Returns a tuple of (cassandra_version, cql_version).
()
| 74 | |
| 75 | |
| 76 | def get_server_versions(): |
| 77 | """ |
| 78 | Probe system.local table to determine Cassandra and CQL version. |
| 79 | Returns a tuple of (cassandra_version, cql_version). |
| 80 | """ |
| 81 | global cass_version, cql_version |
| 82 | |
| 83 | if cass_version is not None: |
| 84 | return (cass_version, cql_version) |
| 85 | |
| 86 | c = TestCluster() |
| 87 | s = c.connect() |
| 88 | row = s.execute('SELECT cql_version, release_version FROM system.local')[0] |
| 89 | |
| 90 | cass_version = _tuple_version(row.release_version) |
| 91 | cql_version = _tuple_version(row.cql_version) |
| 92 | |
| 93 | c.shutdown() |
| 94 | |
| 95 | return (cass_version, cql_version) |
| 96 | |
| 97 | |
| 98 | def _tuple_version(version_string): |