CLI: Dedup repos already in groups

This commit is contained in:
Orsiris de Jong 2024-10-30 19:49:30 +01:00
parent 53591eff8e
commit e1a9dcf3d9

View file

@ -428,6 +428,8 @@ This is free software, and you are welcome to redistribute it under certain cond
level="error",
)
sys.exit(74)
# Cheap duplicate filter
repos_and_group_repos = list(set(repos_and_group_repos))
# Single repo usage
if len(repos_and_group_repos) == 1:
@ -683,15 +685,15 @@ This is free software, and you are welcome to redistribute it under certain cond
"policy",
"housekeeping",
"check",
"quick_check", # TODO: deprecated
"full_check", # TODO: deprecated
"quick_check", # TODO: deprecated
"full_check", # TODO: deprecated
"prune",
"prune_max",
"unlock",
"repair",
"repair_index", # TODO: deprecated
"repair_packs", # TODO: deprecated
"repair_snapshots", # TODO: deprecated
"repair_index", # TODO: deprecated
"repair_packs", # TODO: deprecated
"repair_snapshots", # TODO: deprecated
"recover",
"dump",
"stats",
@ -700,9 +702,10 @@ This is free software, and you are welcome to redistribute it under certain cond
)
if len(repos_and_group_repos) > 1:
if cli_args["operation"] not in possible_group_ops:
json_error_logging(False,
json_error_logging(
False,
f"Invalid group operation {cli_args['operation']}. Valid operations are {','.join(possible_group_ops)}",
"critical"
"critical",
)
sys.exit(74)
repo_config_list = []