From: Eoghan Glynn Date: Fri, 14 Dec 2012 14:19:20 +0000 (+0000) Subject: Remove instance quota re-sync code X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=33b21f3f466d94b83df95d4a756b60ec2a02437d;p=openstack-build%2Fcinder-build.git Remove instance quota re-sync code Obviously came in inadvertantly in a copy'n'paste from the nova quotas logic. Not relevant to volume quotas and would fail if ever called (as instance_data_get_for_project is not part of the cinder DB API). Change-Id: Ib52b962b51003955430ad292084a3e3010736a2c --- diff --git a/cinder/quota.py b/cinder/quota.py index 60d66bdf8..f4b00b826 100644 --- a/cinder/quota.py +++ b/cinder/quota.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""Quotas for instances, volumes, and floating ips.""" +"""Quotas for volumes.""" import datetime @@ -351,7 +351,7 @@ class BaseResource(object): """ Initializes a Resource. - :param name: The name of the resource, i.e., "instances". + :param name: The name of the resource, i.e., "volumes". :param flag: The name of the flag or configuration option which specifies the default value of the quota for this resource. @@ -422,7 +422,7 @@ class ReservableResource(BaseResource): Initializes a ReservableResource. Reservable resources are those resources which directly - correspond to objects in the database, i.e., instances, cores, + correspond to objects in the database, i.e., volumes, gigabytes, etc. A ReservableResource must be constructed with a usage synchronization function, which will be called to determine the current counts of one or more resources. @@ -437,7 +437,7 @@ class ReservableResource(BaseResource): synchronization functions may be associated with more than one ReservableResource. - :param name: The name of the resource, i.e., "instances". + :param name: The name of the resource, i.e., "volumes". :param sync: A callable which returns a dictionary to resynchronize the in_use count for one or more resources, as described above. @@ -467,7 +467,7 @@ class CountableResource(AbsoluteResource): Initializes a CountableResource. Countable resources are those resources which directly - correspond to objects in the database, i.e., instances, cores, + correspond to objects in the database, i.e., volumes, gigabytes, etc., but for which a count by project ID is inappropriate. A CountableResource must be constructed with a counting function, which will be called to determine the current counts @@ -483,7 +483,7 @@ class CountableResource(AbsoluteResource): required functionality, until a better approach to solving this problem can be evolved. - :param name: The name of the resource, i.e., "instances". + :param name: The name of the resource, i.e., "volumes". :param count: A callable which returns the count of the resource. The arguments passed are as described above. @@ -725,13 +725,6 @@ class QuotaEngine(object): return sorted(self._resources.keys()) -def _sync_instances(context, project_id, session): - return dict(zip(('instances', 'cores', 'ram'), - db.instance_data_get_for_project(context, - project_id, - session=session))) - - def _sync_volumes(context, project_id, session): return dict(zip(('volumes', 'gigabytes'), db.volume_data_get_for_project(context,