Remove reserving quotas in c-vol's retype method
Code removed by this commit was there to keep backward compatibility between Liberty and Mitaka. As we're in Pike and we're only constrained to keep compatibility with X-1 release, it's safe to get rid of it. Right now we can assume that quota reservation will always be done in c-api and passed down to c-vol. Change-Id: I67b45662a52a55e88b920c2d0cbe9c20247a8d83
This commit is contained in:
parent
bf20ff6c36
commit
cc0f331e5f
|
@ -2281,32 +2281,6 @@ class VolumeManager(manager.CleanableManager,
|
||||||
volume.update(status_update)
|
volume.update(status_update)
|
||||||
volume.save()
|
volume.save()
|
||||||
|
|
||||||
# If old_reservations has been passed in from the API, we should
|
|
||||||
# skip quotas.
|
|
||||||
# TODO(ntpttr): These reservation checks are left in to be backwards
|
|
||||||
# compatible with Liberty and can be removed in N.
|
|
||||||
if not old_reservations:
|
|
||||||
# Get old reservations
|
|
||||||
try:
|
|
||||||
reserve_opts = {'volumes': -1, 'gigabytes': -volume.size}
|
|
||||||
QUOTAS.add_volume_type_opts(context,
|
|
||||||
reserve_opts,
|
|
||||||
volume.volume_type_id)
|
|
||||||
# NOTE(wanghao): We don't need to reserve volumes and gigabytes
|
|
||||||
# quota for retyping operation since they didn't changed, just
|
|
||||||
# reserve volume_type and type gigabytes is fine.
|
|
||||||
reserve_opts.pop('volumes')
|
|
||||||
reserve_opts.pop('gigabytes')
|
|
||||||
old_reservations = QUOTAS.reserve(context,
|
|
||||||
project_id=project_id,
|
|
||||||
**reserve_opts)
|
|
||||||
except Exception:
|
|
||||||
volume.update(status_update)
|
|
||||||
volume.save()
|
|
||||||
msg = _("Failed to update quota usage while retyping volume.")
|
|
||||||
LOG.exception(msg, resource=volume)
|
|
||||||
raise exception.CinderException(msg)
|
|
||||||
|
|
||||||
# We already got the new reservations
|
# We already got the new reservations
|
||||||
new_reservations = reservations
|
new_reservations = reservations
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue