From 3d50223fe34e03aa595b7ce093391dd2f537123f Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 17 Oct 2022 09:25:49 -0700 Subject: [PATCH] add split and check at beginning --- iso/empanadas/empanadas/util/dnf_utils.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iso/empanadas/empanadas/util/dnf_utils.py b/iso/empanadas/empanadas/util/dnf_utils.py index b797449..fb7e268 100644 --- a/iso/empanadas/empanadas/util/dnf_utils.py +++ b/iso/empanadas/empanadas/util/dnf_utils.py @@ -183,8 +183,18 @@ class RepoSync: # The repo name should be valid if self.repo is not None: - if self.repo not in self.repos: - self.log.error(Color.FAIL + 'Invalid repository: ' + self.repo) + bad_repo_list = [] + repo_list_if_commas = self.repo.split(',') + for repoitem in repo_list_if_commands: + if repoitem not in self.repos: + bad_repo_list.append(repoitem) + + if len(bad_repo_list) > 0: + self.log.error( + Color.BOLD + Color.RED + 'These repos are not listed:' + Color.END + ) + for badrepo in bad_repo_list: + self.log.error(badrepo) raise SystemExit() def run(self):