]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove instance quota re-sync code
authorEoghan Glynn <eglynn@redhat.com>
Fri, 14 Dec 2012 14:19:20 +0000 (14:19 +0000)
committerEoghan Glynn <eglynn@redhat.com>
Fri, 14 Dec 2012 14:27:18 +0000 (14:27 +0000)
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

cinder/quota.py

index 60d66bdf8575617782bc8b59f73ca50a8f79e736..f4b00b8264f6fd7e7d0815566a30ff594e42e100 100644 (file)
@@ -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,