Bug fix: showing a deleted template.

Story: 2005091
Task: 29691

Depends-On: https://review.openstack.org/#/c/649335/
Depends-On: Ib20a24b97709d0d4fe9b35e0c21319407ed3aab1

Change-Id: Idb121516a50aeb1db0859f1a09a390fadec09e74
This commit is contained in:
Naseem Srour 2019-03-06 12:46:11 +00:00 committed by Eyal
parent 302c483bf2
commit db93737bd3
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class TemplateController(RootRestController):
def _show_template(uuid):
try:
templates = pecan.request.storage.templates.query(uuid=uuid)
if not templates:
if not templates or templates[0].status == TStatus.DELETED:
raise VitrageError("Template %s not found", uuid)
return templates[0].file_content
except Exception: