Skip to content

Commit

Permalink
ccmlib/node: run_sstable2json to handle non-exist files
Browse files Browse the repository at this point in the history
seems like introducing of raising failure on any failure
of sstabledump has started to fail some dtests
since it was used in some places right after compation
and some of the sstable were deleted between listing them
to using them with sstable dump, so we need to ignore
failures from non existing files.
  • Loading branch information
fruch committed Aug 2, 2023
1 parent 1d2bf06 commit 69fd294
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,10 @@ def run_sstable2json(self, out_file=None, keyspace=None, datafiles=None, column_
args = sstable2json + [sstablefile]
if enumerate_keys:
args = args + ["-e"]
res = subprocess.run(args, env=env, stdout=out_file, text=True, check=True)
res = subprocess.run(args, env=env, stdout=out_file, stderr=subprocess.PIPE, text=True)
if not res.returncode == 0 and "Cannot find file" not in res.stderr:
common.print_if_standalone(res.stderr, debug_callback=self.info, end='')
raise ToolError(args, exit_status=res.returncode, stdout=res.stdout, stderr=res.stderr)
common.print_if_standalone(res.stdout if res.stdout else '', debug_callback=self.info, end='')

def run_json2sstable(self, in_file, ks, cf, keyspace=None, datafiles=None, column_families=None, enumerate_keys=False):
Expand Down

0 comments on commit 69fd294

Please sign in to comment.