py3: use six.string_types instead of basestring

six is the canonical compatibility library for supporting Python 2 and 3
in a single codebase.

The basestring was removed in Python 3 and we should use 'six.string_types'
instead of 'basestring' to make code compatible with py 2 and 3 as well.

Partially-implements blueprint py3-compatibility

Change-Id: Idb452afdc2a828089627e14f90c53f3967ceb2ad
This commit is contained in:
Valeriy Ponomaryov
2014-07-24 08:29:26 -04:00
parent ca079b22e8
commit 8abe92efa9
7 changed files with 17 additions and 9 deletions

View File

@@ -736,7 +736,7 @@ class QuotaEngine(object):
return self.__driver
if not self._driver_cls:
self._driver_cls = CONF.quota_driver
if isinstance(self._driver_cls, basestring):
if isinstance(self._driver_cls, six.string_types):
self._driver_cls = importutils.import_object(self._driver_cls)
self.__driver = self._driver_cls
return self.__driver