Merge "Ignore not found when delete raw template"

This commit is contained in:
Zuul 2019-10-09 16:30:31 +00:00 committed by Gerrit Code Review
commit 491e2fb470
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)