Merge pull request #1185 from pdebski21/fix_cli_cmd_promotion-nhit

fix cli command api for set parameter promotion-nhit
This commit is contained in:
Karolina Rogowska 2022-04-25 15:41:58 +02:00 committed by GitHub
commit b63f142590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,11 +282,13 @@ def set_param_promotion_cmd(cache_id: str, policy: str, shortcut: bool = False):
def set_param_promotion_nhit_cmd(
cache_id: str, threshold=None, trigger=None, shortcut: bool = False
):
add_param = ""
add_params = ""
if threshold is not None:
add_param += (" -t " if shortcut else " --threshold ") + str(threshold)
add_params += (" -t " if shortcut else " --threshold ") + str(threshold)
if trigger is not None:
add_param += (" -o " if shortcut else " --trigger ") + str(trigger)
add_params += (" -o " if shortcut else " --trigger ") + str(trigger)
return _set_param_cmd(namespace="promotion-nhit", cache_id=cache_id,
additional_params=add_params, shortcut=shortcut)
def set_param_cleaning_cmd(cache_id: str, policy: str, shortcut: bool = False):