py34: fix basestring usage in validator

Change-Id: Ia8ab9435e5eda29d2ff429152a06e5c77ab2a0e4
This commit is contained in:
Andrey Pavlov 2015-09-09 17:55:52 +03:00
parent 7a04b3a5ac
commit 0cc5c2b70e
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import re
import netaddr
from oslo_log import log as logging
import six
from ec2api import exception
from ec2api.i18n import _
@ -25,7 +26,7 @@ LOG = logging.getLogger(__name__)
def validate_str(val, parameter_name, max_length=None):
if (isinstance(val, basestring) and
if (isinstance(val, six.string_types) and
(max_length is None or max_length and len(val) <= max_length)):
return True
raise exception.ValidationError(