(name, durable_writes, strategy_class, strategy_options, connection=None)
| 104 | raise ValueError('Connections must be a list or a tuple.') |
| 105 | |
| 106 | def __create_keyspace(name, durable_writes, strategy_class, strategy_options, connection=None): |
| 107 | cluster = get_cluster(connection) |
| 108 | |
| 109 | if name not in cluster.metadata.keyspaces: |
| 110 | log.info(format_log_context("Creating keyspace %s", connection=connection), name) |
| 111 | ks_meta = metadata.KeyspaceMetadata(name, durable_writes, strategy_class, strategy_options) |
| 112 | execute(ks_meta.as_cql_query(), connection=connection) |
| 113 | else: |
| 114 | log.info(format_log_context("Not creating keyspace %s because it already exists", connection=connection), name) |
| 115 | |
| 116 | if connections: |
| 117 | for connection in connections: |
no test coverage detected