fix: command composition

This commit is contained in:
Roman 2025-02-07 20:41:50 +08:00
parent f3a5117b96
commit b84df0a518
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 17 additions and 17 deletions

View File

@ -32,27 +32,28 @@ class NomosCli:
def run(self, input_values=None, **kwargs):
logger.debug(f"NomosCli initialized with log path {self._log_path}")
self._port_map = {}
cmd = [NOMOS_CLI, self._command]
for flag in nomos_cli[self._command]["flags"]:
for f, indexes in flag:
flag_values_str = f
for j in range(len(indexes)):
flag_values_str = flag_values_str + "'" + input_values[j] + "'"
cmd = cmd + flag_values_str
for f, indexes in flag.items():
cmd.append(f)
for j in indexes:
cmd.append(input_values[j])
logger.debug(f"NomosCli command to run {cmd}")
# self._container = self._docker_manager.start_container(
# self._docker_manager.image,
# port_bindings=self._port_map,
# args=None,
# log_path=self._log_path,
# volumes=self._volumes,
# entrypoint=self._entrypoint,
# remove_container=True,
# name=self._container_name,
# command=cmd
# )
self._container = self._docker_manager.start_container(
self._docker_manager.image,
port_bindings=self._port_map,
args=None,
log_path=self._log_path,
volumes=self._volumes,
entrypoint=self._entrypoint,
remove_container=True,
name=self._container_name,
command=cmd,
)
@retry(stop=stop_after_delay(5), wait=wait_fixed(0.1), reraise=True)
def kill(self):

View File

@ -36,7 +36,6 @@ class TestDataIntegrity(StepsDataAvailability):
delay(10)
received_data = self.get_data_range(self.node2, [0] * 31 + [1], [0] * 8, [0] * 7 + [5])
rcv_data_json = json.dumps(received_data)
# cmd = str(NOMOS_CLI + " reconstruct --app-blobs " + "'" + str(rcv_data_json) + "'")
cli = NomosCli(command="reconstruct")
cli.run(input_values=[str(rcv_data_json)])