[#155] Change args to optionally

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2024-01-11 14:51:07 +03:00 committed by Dmitriy Zayakin
parent a3bda0b34f
commit d6a2cf92a2

View file

@ -68,11 +68,7 @@ class FrostfsCliShards(CliCommand):
return self._execute_with_password(
"control shards set-mode",
wallet_password,
**{
param: value
for param, value in locals().items()
if param not in ["self", "wallet_password"]
},
**{param: value for param, value in locals().items() if param not in ["self", "wallet_password"]},
)
def dump(
@ -105,18 +101,14 @@ class FrostfsCliShards(CliCommand):
return self._execute_with_password(
"control shards dump",
wallet_password,
**{
param: value
for param, value in locals().items()
if param not in ["self", "wallet_password"]
},
**{param: value for param, value in locals().items() if param not in ["self", "wallet_password"]},
)
def list(
self,
endpoint: str,
wallet: str,
wallet_password: str,
wallet: Optional[str] = None,
wallet_password: Optional[str] = None,
address: Optional[str] = None,
json_mode: bool = False,
timeout: Optional[str] = None,
@ -135,12 +127,13 @@ class FrostfsCliShards(CliCommand):
Returns:
Command's result.
"""
if not wallet_password:
return self._execute(
"control shards list",
**{param: value for param, value in locals().items() if param not in ["self"]},
)
return self._execute_with_password(
"control shards list",
wallet_password,
**{
param: value
for param, value in locals().items()
if param not in ["self", "wallet_password"]
},
**{param: value for param, value in locals().items() if param not in ["self", "wallet_password"]},
)