From 1de67f4f635c3dd5e4c1e15b9cb67f4a92a639d4 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Thu, 12 Jul 2018 17:15:11 -0400 Subject: [PATCH] Support loading groups from the kickstart template files. (cherry picked from commit c8d2045f89e5b2955d2696578fdf8fe32a664907) (cherry picked from commit fbda20b8b70ffc31fa9bb4f0725146306d0a39b3) --- src/pylorax/api/compose.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pylorax/api/compose.py b/src/pylorax/api/compose.py index a740c578..56155cd2 100644 --- a/src/pylorax/api/compose.py +++ b/src/pylorax/api/compose.py @@ -74,8 +74,9 @@ def test_templates(dbo, share_dir): ks = KickstartParser(ks_version, errorsAreFatal=False, missingIncludeIsFatal=False) ks.readKickstartFromString(ks_template+"\n%end\n") pkgs = [(name, "*") for name in ks.handler.packages.packageList] + grps = [grp.name for grp in ks.handler.packages.groupList] try: - _ = projects_depsolve(dbo, pkgs, []) + _ = projects_depsolve(dbo, pkgs, grps) except ProjectsError as e: template_errors.append("Error depsolving %s: %s" % (compose_type, str(e))) @@ -271,11 +272,11 @@ def start_build(cfg, dnflock, gitlock, branch, recipe_name, compose_type, test_m ks_version = makeVersion() ks = KickstartParser(ks_version, errorsAreFatal=False, missingIncludeIsFatal=False) ks.readKickstartFromString(ks_template+"\n%end\n") - ks_projects = [(name, "*") for name in ks.handler.packages.packageList] + pkgs = [(name, "*") for name in ks.handler.packages.packageList] + grps = [grp.name for grp in ks.handler.packages.groupList] try: with dnflock.lock: - (template_size, _) = projects_depsolve_with_size(dnflock.dbo, ks_projects, [], - with_core=not ks.handler.packages.nocore) + (template_size, _) = projects_depsolve_with_size(dnflock.dbo, pkgs, grps, with_core=not ks.handler.packages.nocore) except ProjectsError as e: log.error("start_build depsolve: %s", str(e)) raise RuntimeError("Problem depsolving %s: %s" % (recipe["name"], str(e)))