Replace basestring with six.string_types

https://wiki.openstack.org/wiki/Python3

Change-Id: I196dc3194022066992240c169f0b26d1706781fd
This commit is contained in:
rajat29 2017-08-01 11:43:21 +05:30 committed by Rajat Sharma
parent d906c733a2
commit a8a5de9b84
1 changed files with 5 additions and 2 deletions

View File

@ -13,9 +13,12 @@
# under the License.
from decorator import decorator
import json
import flask
import itertools
import json
import six
from distil.models import Tenant
from distil import config
@ -81,7 +84,7 @@ def validate_tenant_id(tenant_id, session):
"""Tenant ID validation that check that the id you passed is valid,
and that a tenant with this ID exists.
- returns tenant query, or a tuple if validation failure."""
if isinstance(tenant_id, basestring):
if isinstance(tenant_id, six.string_types):
tenant_query = session.query(Tenant).\
filter(Tenant.id == tenant_id)
if tenant_query.count() == 0: