From 99cdd573a34109b5654258641b618ecf740bd221 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 3 May 2018 14:18:42 -0700 Subject: [PATCH] Return an empty list if depsolve results are empty --- src/pylorax/api/projects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pylorax/api/projects.py b/src/pylorax/api/projects.py index c5c1b473..862b7bb0 100644 --- a/src/pylorax/api/projects.py +++ b/src/pylorax/api/projects.py @@ -204,7 +204,7 @@ def projects_depsolve(dbo, project_names): raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e))) if len(dbo.transaction) == 0: - raise ProjectsError("No packages installed for %s" % project_names) + return [] return sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower()) @@ -257,7 +257,7 @@ def projects_depsolve_with_size(dbo, project_names, with_core=True): raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e))) if len(dbo.transaction) == 0: - raise ProjectsError("No packages installed for %s" % project_names) + return (0, []) installed_size = estimate_size(dbo.transaction.install_set) deps = sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower())