diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2015-12-21 16:17:34 -0600 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2016-02-02 02:02:53 +0000 |
| commit | 5d1a93362da1109a9f49c32c142a8a4df0a97a9e (patch) | |
| tree | e0ea53537bf4e78314b40e92466e5419fcabb682 /openstackclient/common | |
| parent | e9ff42eee73de147339c42bca90f777a8f40f5c1 (diff) | |
| download | python-openstackclient-5d1a93362da1109a9f49c32c142a8a4df0a97a9e.tar.gz | |
Fix showing network quotas for a project
The OpenStack SDK is now used for the network client. However,
the 'openstack quota show' command wasn't updated for the
client change. As a result, the command will fail to show
network quotas when a project name is specified. For example:
$ openstack quota show admin
'Proxy' object has no attribute 'show_quota'
This patch set fixes the command by using the OpenStack SDK
to get network quotas for a project.
Change-Id: I59a7b6780a7b80cd09e79d40d214751b25d3016e
Related-To: blueprint neutron-client
Closes-Bug: #1528249
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/quota.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index 8a9b910f..56148790 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -196,10 +196,13 @@ class ShowQuota(show.ShowOne): def get_network_quota(self, parsed_args): if parsed_args.quota_class or parsed_args.default: return {} - service_catalog = self.app.client_manager.auth_ref.service_catalog - if 'network' in service_catalog.get_endpoints(): - network_client = self.app.client_manager.network - return network_client.show_quota(parsed_args.project)['quota'] + if self.app.client_manager.is_network_endpoint_enabled(): + identity_client = self.app.client_manager.identity + project = utils.find_resource( + identity_client.projects, + parsed_args.project, + ).id + return self.app.client_manager.network.get_quota(project) else: return {} |
