From 040f648c613db657a8a957b267b584ca132a199c Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Mon, 4 Apr 2022 13:45:00 +0300 Subject: [PATCH] syntax fixes in neofs_verbs.py Signed-off-by: anastasia prasolova --- robot/resources/lib/python/neofs_verbs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/robot/resources/lib/python/neofs_verbs.py b/robot/resources/lib/python/neofs_verbs.py index 92f14ca..a0bbfa7 100644 --- a/robot/resources/lib/python/neofs_verbs.py +++ b/robot/resources/lib/python/neofs_verbs.py @@ -133,8 +133,8 @@ def delete_object(wif: str, cid: str, oid: str, bearer: str="", options: str="") ''' cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wif} ' - f'object delete --cid {cid} --oid {oid} {options}' - f'{"--bearer " + bearer if bearer else ""} ' + f'object delete --cid {cid} --oid {oid} {options} ' + f'{"--bearer " + bearer if bearer else ""}' ) output = _cmd_run(cmd) id_str = output.split('\n')[1] @@ -162,7 +162,7 @@ def get_range(wif: str, cid: str, oid: str, range_file: str, bearer: str, cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wif} ' f'object range --cid {cid} --oid {oid} --range {range_cut} ' - f'--file {ASSETS_DIR}/{range_file} {options}' + f'--file {ASSETS_DIR}/{range_file} {options} ' f'{"--bearer " + bearer if bearer else ""} ' ) _cmd_run(cmd) @@ -190,13 +190,12 @@ def search_object(wif: str, cid: str, keys: str="", bearer: str="", filters: dic if filters: filters_result += "--filters " logger.info(filters) - for key, value in filters.items(): - filters_result += f"'{key} EQ {value}' " + filters_result += ','.join(map(lambda i: f"'{i} EQ {filters[i]}'", filters)) cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wif} ' - f'object search {keys} --cid {cid} {filters_result} {options}' - f'{"--bearer " + bearer if bearer else ""} ' + f'object search {keys} --cid {cid} {filters_result} {options} ' + f'{"--bearer " + bearer if bearer else ""}' ) output = _cmd_run(cmd)