Ignore not found when delete raw template

Change-Id: Ia13f2b840379a7b7addf0e02ae3fc820a686c062
Story: #2002066
Task: #19719
Task: 36945
This commit is contained in:
ricolin 2018-05-20 00:43:44 +08:00 committed by Rico Lin
parent fdfa5e6a65
commit eb533876a3
1 changed files with 6 additions and 1 deletions

View File

@ -153,7 +153,12 @@ def raw_template_delete(context, template_id):
# delete that too
if session.query(models.RawTemplate).filter_by(
files_id=raw_tmpl_files_id).first() is None:
raw_tmpl_files = raw_template_files_get(context, raw_tmpl_files_id)
try:
raw_tmpl_files = raw_template_files_get(
context, raw_tmpl_files_id)
except exception.NotFound:
# Ignore not found
return
session.delete(raw_tmpl_files)