Replace basestring with six.string_types

six.string_types
  Possible types for text data. This is basestring() in Python 2
  and str in Python 3.

Partial implements: blueprint py33-support

Change-Id: I25b463efdfe2e20af92dd805d4f44b40d4bd4b35
This commit is contained in:
Kui Shi
2013-10-15 16:47:58 +08:00
parent 5de4b935a4
commit 0127670f04

View File

@@ -15,12 +15,14 @@
from __future__ import print_function
from troveclient import exceptions
import six
def get_authenticator_cls(cls_or_name):
"""Factory method to retrieve Authenticator class."""
if isinstance(cls_or_name, type):
return cls_or_name
elif isinstance(cls_or_name, basestring):
elif isinstance(cls_or_name, six.string_types):
if cls_or_name == "keystone":
return KeyStoneV2Authenticator
elif cls_or_name == "rax":