Avoid TokenAware failure when keyspace not set

PYTHON-181; fixes KeyError when routing_key set with no keyspace
This commit is contained in:
Adam Holmberg
2014-12-02 16:44:37 +00:00
parent cee2f673c0
commit c875016c6a

View File

@@ -359,7 +359,7 @@ class TokenAwarePolicy(LoadBalancingPolicy):
yield host yield host
else: else:
routing_key = query.routing_key routing_key = query.routing_key
if routing_key is None: if routing_key is None or keyspace is None:
for host in child.make_query_plan(keyspace, query): for host in child.make_query_plan(keyspace, query):
yield host yield host
else: else: