Skip to content

Commit

Permalink
support multiple identical args in SCYLLA_EXT_OPTS
Browse files Browse the repository at this point in the history
since we have cases multiple `--experimental-features` needs
to be passed via `SCYLLA_EXT_OPTS`, adding support for key
with multiple values in `process_opts()`

fixes: #540
closes: #541
  • Loading branch information
fruch committed Feb 6, 2024
1 parent c2bba25 commit ebfc7f4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ccmlib/scylla_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ def process_opts(opts):
vals.append(opts[opts_i])
opts_i += 1
val = ' '.join(vals)
if key not in ext_args and not key.startswith("--scylla-manager"):
ext_args[key] = val
if not key.startswith("--scylla-manager"):
ext_args.setdefault(key, []).append(val)
return ext_args

# Lets search for default overrides in SCYLLA_EXT_OPTS
Expand All @@ -589,15 +589,15 @@ def process_opts(opts):
# precalculate self._mem_mb_per_cpu if --memory is given in SCYLLA_EXT_OPTS
# and it wasn't set explicitly by the test
if not self._mem_mb_set_during_test and '--memory' in env_args:
memory = self.parse_size(env_args['--memory'])
memory = self.parse_size(env_args['--memory'][0])
smp = int(env_args['--smp']) if '--smp' in env_args else self._smp
self._mem_mb_per_cpu = int((memory / smp) // MB)

cmd_args = process_opts(jvm_args)

# use '--memory' in jmv_args if mem_mb_per_cpu was not set by the test
if not self._mem_mb_set_during_test and '--memory' in cmd_args:
self._memory = self.parse_size(cmd_args['--memory'])
self._memory = self.parse_size(cmd_args['--memory'][0])

ext_args = env_args
ext_args.update(cmd_args)
Expand All @@ -607,9 +607,11 @@ def process_opts(opts):
if not self._smp_set_during_test:
self._smp = int(v)
elif k != '--memory':
args.append(k)
if v:
args.append(v)
for val in v:
args += [k, val]
else:
args.append(k)

args.extend(translated_args)

Expand Down

0 comments on commit ebfc7f4

Please sign in to comment.