diff options
author | Zuul <zuul@review.openstack.org> | 2018-01-02 18:08:20 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-01-02 18:08:20 +0000 |
commit | 92405514f0534a169f1845c24ad7935086c7cfa4 (patch) | |
tree | 3eea006feb3bdfa11e8868a25db0c652f3c31d0b | |
parent | 60e6a3d7d60f5cd91b712a5896b7a9e88fd11aef (diff) | |
parent | f4009a71a0ee72346be1ad4af8f79b915367abaa (diff) | |
download | python-novaclient-92405514f0534a169f1845c24ad7935086c7cfa4.tar.gz |
Merge "Remove incorrect legacy QuotaSet.id property"
-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' |