Fix a possible shared quota consistency issue

It may happen that a VM instance goes in error during the building phase.
Although the server is deleted by Synergy, the compute node may not send
the notification about the cancellation by leaving the shared quota not
consistent. This fix addresses this issue.

Bug: #1668199
Change-Id: I9ff9eed7b234117e24ae629fdd3e00ae7ce528cd
Sem-Ver: bugfix
This commit is contained in:
Lisa Zangrando 2017-02-27 10:17:11 +01:00
parent 92892640d7
commit b16ab75ca6
1 changed files with 6 additions and 0 deletions

View File

@ -137,6 +137,12 @@ class Notifications(object):
LOG.error("cannot delete server %s: %s"
% (server_id, ex))
try:
quota.release(server)
except Exception as ex:
LOG.warn("cannot release server %s "
"(reason=%s)" % (server_id, ex))
def warn(self, ctxt, publisher_id, event_type, payload, metadata):
LOG.debug("Notification WARN: event_type=%s, payload=%s metadata=%s"
% (event_type, payload, metadata))