Skip to content

Commit 2d17c1b

Browse files
tests/integration/standard: return empty query plan if there are no live hosts
1 parent c306d61 commit 2d17c1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/integration/standard/test_query.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ def make_query_plan(self, working_keyspace=None, query=None):
460460
live_hosts = sorted(list(self._live_hosts))
461461
host = []
462462
try:
463-
host = [live_hosts[self.host_index_to_use]]
463+
if len(live_hosts) > 0:
464+
host = [live_hosts[self.host_index_to_use]]
464465
except IndexError as e:
465466
raise IndexError(
466467
'You specified an index larger than the number of hosts. Total hosts: {}. Index specified: {}'.format(

0 commit comments

Comments
 (0)