diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-10 23:12:37 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-10 23:12:37 +0000 |
| commit | 13c23fd68e7d82a0b09d91f20c7d57d2e7c16350 (patch) | |
| tree | fb12ec5226f002146cf7bf9ec9a050574d678c91 | |
| parent | 7e944c0e8dfd31c9adb05c1a1887898669e27ab6 (diff) | |
| parent | a811692056fa2919028ebd18d268fc7325a7481f (diff) | |
Merge "Make sure reservations is initialized"
| -rw-r--r-- | nova/compute/api.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 4c02dcd5a..1e1c82a8f 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -887,21 +887,20 @@ class API(base.Base): def _delete(self, context, instance): host = instance['host'] + reservations = None try: old, updated = self._update(context, instance, task_state=task_states.DELETING, progress=0) + # Avoid double-counting the quota usage reduction + # where delete is already in progress if old['task_state'] != task_states.DELETING: reservations = QUOTAS.reserve(context, instances=-1, cores=-instance['vcpus'], ram=-instance['memory_mb']) - else: - # Avoid double-counting the quota usage reduction - # where delete is already in progress - reservations = None if not instance['host']: # Just update database, nothing else we can do |
