Merge "Remove incorrect legacy QuotaSet.id property"
This commit is contained in:
commit
92405514f0
|
@ -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