From 449e525179bff36e7071087e83b40c835294d2ad Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Wed, 28 May 2014 10:20:49 -0500 Subject: [PATCH] Make DELETE request return 404 for nonexistant package Change the package_delete function to use the _package_get helper function which will correctly raise the right exception for a package not existing. Change-Id: I1e83067b9769221dc5531d2de891960ce7846b6e Closes-Bug: #1309413 --- murano/db/catalog/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/murano/db/catalog/api.py b/murano/db/catalog/api.py index 069e4ac4..edf6f8a5 100644 --- a/murano/db/catalog/api.py +++ b/murano/db/catalog/api.py @@ -401,7 +401,7 @@ def package_delete(package_id, context): session = db_session.get_session() with session.begin(): - package = session.query(models.Package).get(package_id) + package = _package_get(package_id, session) _authorize_package(package, context) session.delete(package)