summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-01 00:03:09 +0000
committerGerrit Code Review <review@openstack.org>2015-12-01 00:03:10 +0000
commite6057f088b71ec197e444fe4ab570cc0a7c35f35 (patch)
tree82102bf03dcf86585a56b289224d1aed07c3cada /openstackclient/common
parent10aa2d9b0ffc1a77d0c62531a4591979e0d2b983 (diff)
parent0ccd2a8108d71fffa1fda13022d52c3a38371ce6 (diff)
downloadpython-openstackclient-e6057f088b71ec197e444fe4ab570cc0a7c35f35.tar.gz
Merge "Add project name/ID validation for "openstack quota show""
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/quota.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index c5404f07..8a9b910f 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -173,13 +173,19 @@ class ShowQuota(show.ShowOne):
return parser
def get_compute_volume_quota(self, client, parsed_args):
+ identity_client = self.app.client_manager.identity
+ project = utils.find_resource(
+ identity_client.projects,
+ parsed_args.project,
+ ).id
+
try:
if parsed_args.quota_class:
- quota = client.quota_classes.get(parsed_args.project)
+ quota = client.quota_classes.get(project)
elif parsed_args.default:
- quota = client.quotas.defaults(parsed_args.project)
+ quota = client.quotas.defaults(project)
else:
- quota = client.quotas.get(parsed_args.project)
+ quota = client.quotas.get(project)
except Exception as e:
if type(e).__name__ == 'EndpointNotFound':
return {}