From b84b7daaf83b8280d4a80ca00c4d5e3783a162db Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Thu, 1 Nov 2012 15:53:27 +0000 Subject: Fix quota updating during soft delete and restore Fixes bug 1075716 Quotas were not properly updated when soft deletes were enabled. This patch fixes quotas for soft deletes and restores. Change-Id: I77fd3ff76caa9eba3e2180c1abcfb390ea7857d6 --- nova/api/openstack/compute/contrib/deferred_delete.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/deferred_delete.py b/nova/api/openstack/compute/contrib/deferred_delete.py index 8eaea04bb..ea7ac00f9 100644 --- a/nova/api/openstack/compute/contrib/deferred_delete.py +++ b/nova/api/openstack/compute/contrib/deferred_delete.py @@ -42,6 +42,9 @@ class DeferredDeleteController(wsgi.Controller): instance = self.compute_api.get(context, id) try: self.compute_api.restore(context, instance) + except exception.QuotaError as error: + raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error), + headers={'Retry-After': 0}) except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'restore') -- cgit