]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Quota model: use HasTenantId mixin
authorSalvatore Orlando <salv.orlando@gmail.com>
Thu, 16 Apr 2015 18:57:37 +0000 (11:57 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Thu, 16 Apr 2015 19:12:47 +0000 (12:12 -0700)
This change simply changes the Quota model class to obtain
the tenant_id from the mixin class. As the attribute in the
mixin is identical to that in the model there is no need for
a migration.

This patch also removes a reference to quota classes in the
docstring, as Neutron does not implement those. It is good
to be careful when copying and paste code.

Change-Id: Idab15d5ef2ddd2b830a7dcde46990506064535f7
Closes-Bug: #1445169

neutron/db/quota_db.py

index 262b8f85fcab8223a66edf86b0b06c41dafbaf7f..ad7196675f3b1b93aab5c5b9d7f8067d2f9ff0c2 100644 (file)
@@ -20,13 +20,12 @@ from neutron.db import model_base
 from neutron.db import models_v2
 
 
-class Quota(model_base.BASEV2, models_v2.HasId):
+class Quota(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
     """Represent a single quota override for a tenant.
 
     If there is no row for a given tenant id and resource, then the
-    default for the quota class is used.
+    default for the deployment is used.
     """
-    tenant_id = sa.Column(sa.String(255), index=True)
     resource = sa.Column(sa.String(255))
     limit = sa.Column(sa.Integer)