Snapshot reservation sync calls wrong resource.

The snapshot reservations code isn't calling the
correct resource on sync (it's calling volumes).  There's
also some problems with the logic being used on the delete/clean up
that are fixed here as well.

Fixes bug: 1157506
Fixes bug: 1157982

Change-Id: I91327b8043ab63aa35ea8a91b6de544bf5bf6c61
This commit is contained in:
john-griffith
2013-03-21 09:48:03 -06:00
parent 65e2910546
commit b450eef832
7 changed files with 38 additions and 13 deletions

View File

@@ -491,8 +491,11 @@ class API(base.Base):
raise exception.InvalidVolume(reason=msg)
try:
reservations = QUOTAS.reserve(context, snapshots=1,
gigabytes=volume['size'])
if FLAGS.no_snapshot_gb_quota:
reservations = QUOTAS.reserve(context, snapshots=1)
else:
reservations = QUOTAS.reserve(context, snapshots=1,
gigabytes=volume['size'])
except exception.OverQuota as e:
overs = e.kwargs['overs']
usages = e.kwargs['usages']