Use six.string_types instead of "basestring"

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Petr Viktorin
2015-08-10 18:29:33 +02:00
committed by Jan Cholasta
parent 404177f7a3
commit dd16cc98b0
22 changed files with 114 additions and 71 deletions

View File

@@ -20,6 +20,8 @@
import shlex
import re
import six
# The Python re module doesn't do nested parenthesis
# Break the ACI into 3 pieces: target, name, permissions/bind_rules
@@ -159,7 +161,7 @@ class ACI:
raise SyntaxError, "invalid permission: '%s'" % p
if not self.name:
raise SyntaxError, "name must be set"
if not isinstance(self.name, basestring):
if not isinstance(self.name, six.string_types):
raise SyntaxError, "name must be a string"
if not isinstance(self.target, dict) or len(self.target) == 0:
raise SyntaxError, "target must be a non-empty dictionary"