Avoid deleting parent backup failed caused by 404
Catch NotFound exception in for loop, to avoid dropping out while deleting parent backup that has multiple children backups. Change-Id: Idab9fc8d6c09b0b58015b0b9fdf99811d075191f Closes-bug: #1718572
This commit is contained in:
parent
d7b773d2b0
commit
6318e74928
@ -265,7 +265,10 @@ class Backup(object):
|
||||
query = DBBackup.query()
|
||||
query = query.filter_by(parent_id=backup_id, deleted=False)
|
||||
for child in query.all():
|
||||
cls.delete(context, child.id)
|
||||
try:
|
||||
cls.delete(context, child.id)
|
||||
except exception.NotFound:
|
||||
LOG.exception(_("Backup %s cannot be found."), backup_id)
|
||||
|
||||
def _delete_resources():
|
||||
backup = cls.get_by_id(context, backup_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user