Merge "Specify alternate_id in network quota"
This commit is contained in:
commit
84d44a8d24
|
@ -44,7 +44,7 @@ class Quota(resource.Resource):
|
||||||
#: The maximum amount of ports you can create. *Type: int*
|
#: The maximum amount of ports you can create. *Type: int*
|
||||||
ports = resource.Body('port', type=int)
|
ports = resource.Body('port', type=int)
|
||||||
#: The ID of the project these quota values are for.
|
#: 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*
|
#: The maximum amount of RBAC policies you can create. *Type: int*
|
||||||
rbac_policies = resource.Body('rbac_policy', type=int)
|
rbac_policies = resource.Body('rbac_policy', type=int)
|
||||||
#: The maximum amount of routers you can create. *Type: int*
|
#: The maximum amount of routers you can create. *Type: int*
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from openstack.tests.functional import base
|
from openstack.tests.functional import base
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +20,6 @@ class TestQuota(base.BaseFunctionalTest):
|
||||||
self.assertIsNotNone(qot.project_id)
|
self.assertIsNotNone(qot.project_id)
|
||||||
self.assertIsNotNone(qot.networks)
|
self.assertIsNotNone(qot.networks)
|
||||||
|
|
||||||
@unittest.skip('bug/1687202')
|
|
||||||
def test_set(self):
|
def test_set(self):
|
||||||
attrs = {'networks': 123456789}
|
attrs = {'networks': 123456789}
|
||||||
for project_quota in self.conn.network.quotas():
|
for project_quota in self.conn.network.quotas():
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from openstack.network.v2 import quota
|
from openstack.network.v2 import quota
|
||||||
|
from openstack import resource2 as resource
|
||||||
|
|
||||||
IDENTIFIER = 'IDENTIFIER'
|
IDENTIFIER = 'IDENTIFIER'
|
||||||
EXAMPLE = {
|
EXAMPLE = {
|
||||||
|
@ -73,6 +74,13 @@ class TestQuota(testtools.TestCase):
|
||||||
response = quota_obj._prepare_request()
|
response = quota_obj._prepare_request()
|
||||||
self.assertNotIn('id', response)
|
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):
|
class TestQuotaDefault(testtools.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue