]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix quota updating when admin deletes common user's volume
authorYug Suo <yugsuo@gmail.com>
Mon, 11 Mar 2013 08:30:07 +0000 (16:30 +0800)
committerGuangyu Suo <yugsuo@gmail.com>
Sun, 24 Mar 2013 03:52:35 +0000 (11:52 +0800)
commit576c9b0880c32bfc8053550b8f25a76df98c60e4
tree7484d7c76a365faa4a849de81aaa6f8f63e4686c
parentf53d48ebd9ff0e3b99470a9b95527c7054709c12
Fix quota updating when admin deletes common user's volume

Add 'project_id=None' optional argument in QUOTAS related methods.

There are two problems when admin deletes volumes of common user
before fixing this bug:
Firstly, It will get tenant quotas using context.project_id which
results in getting admin's quotas not common user's.
Secondly, It will also get wrong quota usages using context.project_id
when updating common user's quota_usages.

So we could pass into QUOTAS related methods an optional argument to
specify the tenant ID to be affected. And if it's not set, then we
default to drawing the tenant ID from the context.

Fixes: bug 1078668
Change-Id: Ie250da84726d1c5c3280430038184000dfd1e9e2
cinder/db/api.py
cinder/db/sqlalchemy/api.py
cinder/quota.py
cinder/tests/test_quota.py
cinder/tests/test_volume.py
cinder/volume/api.py
cinder/volume/manager.py