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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user