summaryrefslogtreecommitdiff
path: root/keystoneclient/utils.py
diff options
context:
space:
mode:
authorYangLei <yanglyy@cn.ibm.com>2013-09-06 17:24:05 +0800
committerYangLei <yanglyy@cn.ibm.com>2013-09-06 18:06:55 +0800
commit54ff0729566c600859e54af9019b68f8cf814667 (patch)
treec449a7cfe55d31878c6e7493c6e14a437257b25d /keystoneclient/utils.py
parent661d6cf783d1586e435196f38ffb1b2361b8fe25 (diff)
downloadpython-keystoneclient-54ff0729566c600859e54af9019b68f8cf814667.tar.gz
Decode the non-english username str to unicode
convert the non-english username str to unicode, then the converted username can match the username from db. Fixes bug #1221576 Change-Id: I9e5f941fe43f081d75750e3f4754e8beea8210db
Diffstat (limited to 'keystoneclient/utils.py')
-rw-r--r--keystoneclient/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py
index 479f7c0..ae489c8 100644
--- a/keystoneclient/utils.py
+++ b/keystoneclient/utils.py
@@ -99,6 +99,8 @@ def find_resource(manager, name_or_id):
# finally try to find entity by name
try:
+ if isinstance(name_or_id, str):
+ name_or_id = name_or_id.decode('utf-8', 'strict')
return manager.find(name=name_or_id)
except exceptions.NotFound:
msg = ("No %s with a name or ID of '%s' exists." %