From a8a5de9b8463c5d0dd31ad492066418e91ad7141 Mon Sep 17 00:00:00 2001 From: rajat29 Date: Tue, 1 Aug 2017 11:43:21 +0530 Subject: [PATCH] Replace basestring with six.string_types https://wiki.openstack.org/wiki/Python3 Change-Id: I196dc3194022066992240c169f0b26d1706781fd --- distil/api/helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/distil/api/helpers.py b/distil/api/helpers.py index d84f38d..386df2a 100644 --- a/distil/api/helpers.py +++ b/distil/api/helpers.py @@ -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: