Merge "Specify alternate_id in network quota"

This commit is contained in:
Jenkins 2017-05-04 15:01:37 +00:00 committed by Gerrit Code Review
commit 84d44a8d24
3 changed files with 9 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class Quota(resource.Resource):
#: The maximum amount of ports you can create. *Type: int*
ports = resource.Body('port', type=int)
#: The ID of the project these quota values are for.
project_id = resource.Body('tenant_id')
project_id = resource.Body('tenant_id', alternate_id=True)
#: The maximum amount of RBAC policies you can create. *Type: int*
rbac_policies = resource.Body('rbac_policy', type=int)
#: The maximum amount of routers you can create. *Type: int*

View File

@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import unittest
from openstack.tests.functional import base
@ -22,7 +20,6 @@ class TestQuota(base.BaseFunctionalTest):
self.assertIsNotNone(qot.project_id)
self.assertIsNotNone(qot.networks)
@unittest.skip('bug/1687202')
def test_set(self):
attrs = {'networks': 123456789}
for project_quota in self.conn.network.quotas():

View File

@ -13,6 +13,7 @@
import testtools
from openstack.network.v2 import quota
from openstack import resource2 as resource
IDENTIFIER = 'IDENTIFIER'
EXAMPLE = {
@ -73,6 +74,13 @@ class TestQuota(testtools.TestCase):
response = quota_obj._prepare_request()
self.assertNotIn('id', response)
def test_alternate_id(self):
my_tenant_id = 'my-tenant-id'
body = {'tenant_id': my_tenant_id, 'network': 12345}
quota_obj = quota.Quota(**body)
self.assertEqual(my_tenant_id,
resource.Resource._get_id(quota_obj))
class TestQuotaDefault(testtools.TestCase):