diff options
author | Matt Riedemann <mriedem.os@gmail.com> | 2018-01-02 10:15:46 -0500 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2018-01-02 10:20:25 -0500 |
commit | f4009a71a0ee72346be1ad4af8f79b915367abaa (patch) | |
tree | c1f4097aa44cdfa504afaafa06a4ac5cf7a2711c | |
parent | 852bd46805098e03fdd85a83ccbeec403bfb4836 (diff) | |
download | python-novaclient-f4009a71a0ee72346be1ad4af8f79b915367abaa.tar.gz |
Remove incorrect legacy QuotaSet.id property
The QuotaSet.id property was added in commit
d17505462db3876a781016b16464e8ed967ae50d 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
-rw-r--r-- | novaclient/tests/unit/fixture_data/quotas.py | 10 | ||||
-rw-r--r-- | novaclient/v2/quotas.py | 11 |
2 files changed, 7 insertions, 14 deletions
diff --git a/novaclient/tests/unit/fixture_data/quotas.py b/novaclient/tests/unit/fixture_data/quotas.py index a6931fcc..e3d179e2 100644 --- a/novaclient/tests/unit/fixture_data/quotas.py +++ b/novaclient/tests/unit/fixture_data/quotas.py @@ -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 } diff --git a/novaclient/v2/quotas.py b/novaclient/v2/quotas.py index 1aee5b17..0e421169 100644 --- a/novaclient/v2/quotas.py +++ b/novaclient/v2/quotas.py @@ -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' |