Skip to content

Commit

Permalink
fix(nemesis): fix prepare_start_stop_compaction
Browse files Browse the repository at this point in the history
fix fail prepare_start_stop_compaction
in case of no non system ks_cf
  • Loading branch information
temichus authored and roydahan committed Feb 19, 2023
1 parent fa21536 commit 3c58029
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,11 @@ def _get_random_non_system_ks_cf(self, filter_empty_tables: bool = True) -> tupl
call split() on the output to get keyspace_name and
cf_name separately.
"""
ks_cf = random.choice(self.cluster.get_non_system_ks_cf_list(
db_node=self.target_node, filter_empty_tables=filter_empty_tables))
return ks_cf.split(".") if ks_cf else None
if ks_cf_list := self.cluster.get_non_system_ks_cf_list(
db_node=self.target_node, filter_empty_tables=filter_empty_tables):
return random.choice(ks_cf_list).split(".")
else:
return None, None

def _prepare_start_stop_compaction(self) -> StartStopCompactionArgs:
self.set_target_node()
Expand Down

0 comments on commit 3c58029

Please sign in to comment.