Remove incorrect legacy QuotaSet.id property
The QuotaSet.id property was added in commit
d17505462d
assertin
that the os-quota-set response had no id in it, but
it always has, ever since the API was added in commit
6220c4276e30c633ffc4165ce6db0d120c0e88a7 in nova.
This change removes the incorrect property and fixture
data that returns a tenant_id in the response which the
API doesn't actually do.
The test_quota fixture data is also updated to fix the
name on the key_pairs key and add missing keys in the
response for server groups.
Change-Id: Ifaf59813e75876334dcc2ac239ed6bdddb495aa7
This commit is contained in:
parent
852bd46805
commit
f4009a71a0
|
@ -52,8 +52,8 @@ class V1(base.Fixture):
|
|||
|
||||
def test_quota(self, tenant_id='test'):
|
||||
return {
|
||||
'tenant_id': tenant_id,
|
||||
'metadata_items': [],
|
||||
'id': tenant_id,
|
||||
'metadata_items': 1,
|
||||
'injected_file_content_bytes': 1,
|
||||
'injected_file_path_bytes': 1,
|
||||
'ram': 1,
|
||||
|
@ -61,7 +61,9 @@ class V1(base.Fixture):
|
|||
'instances': 1,
|
||||
'injected_files': 1,
|
||||
'cores': 1,
|
||||
'keypairs': 1,
|
||||
'key_pairs': 1,
|
||||
'security_groups': 1,
|
||||
'security_group_rules': 1
|
||||
'security_group_rules': 1,
|
||||
'server_groups': 1,
|
||||
'server_group_members': 1
|
||||
}
|
||||
|
|
|
@ -18,15 +18,8 @@ from novaclient import base
|
|||
|
||||
class QuotaSet(base.Resource):
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""QuotaSet does not have a 'id' attribute but base.Resource needs it
|
||||
to self-refresh and QuotaSet is indexed by tenant_id.
|
||||
"""
|
||||
return self.tenant_id
|
||||
|
||||
def update(self, *args, **kwargs):
|
||||
return self.manager.update(self.tenant_id, *args, **kwargs)
|
||||
return self.manager.update(self.id, *args, **kwargs)
|
||||
|
||||
|
||||
class QuotaSetManager(base.Manager):
|
||||
|
@ -37,8 +30,6 @@ class QuotaSetManager(base.Manager):
|
|||
if detail:
|
||||
url += '/detail'
|
||||
|
||||
if hasattr(tenant_id, 'tenant_id'):
|
||||
tenant_id = tenant_id.tenant_id
|
||||
if user_id:
|
||||
params = {'tenant_id': tenant_id, 'user_id': user_id}
|
||||
url += '?user_id=%(user_id)s'
|
||||
|
|
Loading…
Reference in New Issue