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", level="error",
) )
sys.exit(74) sys.exit(74)
# Cheap duplicate filter
repos_and_group_repos = list(set(repos_and_group_repos))
# Single repo usage # Single repo usage
if len(repos_and_group_repos) == 1: if len(repos_and_group_repos) == 1:
@ -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 len(repos_and_group_repos) > 1:
if cli_args["operation"] not in possible_group_ops: 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)}", f"Invalid group operation {cli_args['operation']}. Valid operations are {','.join(possible_group_ops)}",
"critical" "critical",
) )
sys.exit(74) sys.exit(74)
repo_config_list = [] repo_config_list = []