Move str to six.string_types

six.string_types is recommended for py2/3 combination.

Change-Id: I14008d3c0d2d82087aec5ca8a6e40d698b31ea78
This commit is contained in:
jichenjc 2018-08-22 03:08:42 +08:00
parent a77f11c9c1
commit d36f05ffe9
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
# under the License.
import functools
import six
import nova.api.openstack
from nova.api.openstack.compute import admin_actions
@ -879,7 +880,7 @@ class APIRouterV21(base_wsgi.Router):
# For example, the request to the '' will be redirect to the '/' in
# the Nova API. To indicate that, using the target path instead of
# a dict. The route entry just writes as "('', '/)".
if isinstance(methods, str):
if isinstance(methods, six.string_types):
self.map.redirect(path, methods)
continue