From 5d1a93362da1109a9f49c32c142a8a4df0a97a9e Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Mon, 21 Dec 2015 16:17:34 -0600 Subject: 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 --- openstackclient/common/quota.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'openstackclient/common') 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 {} -- cgit v1.2.1