]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Disallow quota deletes if default under usage
authorRyan McNair <rdmcnair@us.ibm.com>
Thu, 10 Mar 2016 20:15:24 +0000 (20:15 +0000)
committerRyan McNair <rdmcnair@us.ibm.com>
Thu, 10 Mar 2016 20:35:08 +0000 (20:35 +0000)
commitcafe657c11f444c514f8eed44feb7dd7de23e62c
tree326f6a772ba387d0d5e6ad92dac39c0be7ee1cfb
parenta63bfeac76c181f8a74f75658a9d14b1647a30e1
Disallow quota deletes if default under usage

For nested quotas, currently we don't allow the limit to be updated
below the current usage since this could make a portion of the
quota tree "invalid". This is explicitly disallowed for quota update
but not currently checked on quota delete. This patch adds the same
checking behavior for quota-deletes. Also, the quota delete
authentication check is being moved above the validation code, so that
a user not allowed to perform a delete will always see an unauthorized
error instead of any other invalid errors with the request.

Change-Id: I390ffa38b6c03c034614756ca410dfca9e52f2ce
Closes-Bug: #1555802
cinder/api/contrib/quotas.py
cinder/tests/unit/api/contrib/test_quotas.py