Do not log an exception if Allocation is deleted during handling.

This is a normal situation and should not report a traceback.

Change-Id: I497d3aaae91e8aa87649323874121eb6e81c5fd8
This commit is contained in:
Dmitry Tantsur 2019-04-18 15:02:13 +02:00 committed by Dmitry Tantsur
parent 9a0bd8a774
commit c2ab34a8c7

View File

@ -90,6 +90,8 @@ def _allocation_failed(allocation, reason):
allocation.state = states.ERROR
allocation.last_error = str(reason)
allocation.save()
except exception.AllocationNotFound as exc:
LOG.debug('Not saving a failed allocation: %s', exc)
except Exception:
LOG.exception('Could not save the failed allocation %s',
allocation.uuid)