forked from TrueCloudLab/frostfs-testlib
Add GenericCli utility
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
4f3814690e
commit
751381cd60
8 changed files with 80 additions and 71 deletions
|
@ -54,7 +54,7 @@ class Host(ABC):
|
|||
raise ValueError(f"Unknown service name: '{service_name}'")
|
||||
return service_config
|
||||
|
||||
def get_cli_config(self, cli_name: str) -> CLIConfig:
|
||||
def get_cli_config(self, cli_name: str, allow_empty: bool = False) -> CLIConfig:
|
||||
"""Returns config of CLI tool with specified name.
|
||||
|
||||
The CLI must be located on this host.
|
||||
|
@ -66,7 +66,7 @@ class Host(ABC):
|
|||
Config of the CLI tool.
|
||||
"""
|
||||
cli_config = self._cli_config_by_name.get(cli_name)
|
||||
if cli_config is None:
|
||||
if cli_config is None and not allow_empty:
|
||||
raise ValueError(f"Unknown CLI name: '{cli_name}'")
|
||||
return cli_config
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue