Fix "sevice show" cannot catch NoUniqueMatch Exception

Fix a bug for "service show" subcommand cannot cache NoUniqueMatch Exception

Change-Id: I393c5417de0fef424618b08119ddbc8fea27e114
Closes-Bug: #1524305
This commit is contained in:
Min Min Ren 2015-12-09 05:42:18 +08:00
parent b60a9492a3
commit b98aee57c1

View File

@ -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):