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
This commit is contained in:
Cyril Roelandt
2013-12-16 15:52:24 +01:00
parent 3f1cd0ef37
commit f9e3b7adc9

View File

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