From f9e3b7adc980ae6722dfa59f8785ccaa4dc45c04 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 16 Dec 2013 15:52:24 +0100 Subject: [PATCH] Do not try to call decode() on a text string This fixes a call to 'isinstance' that only worked on Python2. Closes-Bug: #1265879 Change-Id: I886da95f1ad2a8314de92be8aecb354ee3124e6d --- keystoneclient/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py index a39af23c3..b2e371b1f 100644 --- a/keystoneclient/utils.py +++ b/keystoneclient/utils.py @@ -101,7 +101,7 @@ def find_resource(manager, name_or_id): # finally try to find entity by name try: - if isinstance(name_or_id, str): + if isinstance(name_or_id, six.binary_type): name_or_id = name_or_id.decode('utf-8', 'strict') return manager.find(name=name_or_id) except exceptions.NotFound: