summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMin Min Ren <rminmin@cn.ibm.com>2015-12-09 05:42:18 +0800
committerMin Min Ren <rminmin@cn.ibm.com>2015-12-09 05:47:12 +0800
commitb98aee57c10917d5f57f2ed3cfae3ce67e33496c (patch)
treefbd9a458e30fefb461f62f1974d0872743f8b370
parentb60a9492a31bb1130338176e4b90a7572c10edc3 (diff)
downloadpython-openstackclient-b98aee57c10917d5f57f2ed3cfae3ce67e33496c.tar.gz
Fix "sevice show" cannot catch NoUniqueMatch Exception
Fix a bug for "service show" subcommand cannot cache NoUniqueMatch Exception Change-Id: I393c5417de0fef424618b08119ddbc8fea27e114 Closes-Bug: #1524305
-rw-r--r--openstackclient/identity/common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py
index d0edb0bd..2afa41fb 100644
--- a/openstackclient/identity/common.py
+++ b/openstackclient/identity/common.py
@@ -41,6 +41,11 @@ def find_service(identity_client, name_type_or_id):
msg = ("No service with a type, name or ID of '%s' exists."
% name_type_or_id)
raise exceptions.CommandError(msg)
+ except identity_exc.NoUniqueMatch:
+ msg = ("Multiple service matches found for '%s', "
+ "use an ID to be more specific."
+ % name_type_or_id)
+ raise exceptions.CommandError(msg)
def _get_domain_id_if_requested(identity_client, domain_name_or_id):