summaryrefslogtreecommitdiff
path: root/oslo_policy/_checks.py
diff options
context:
space:
mode:
authorhaixin <haixin@inspur.com>2020-09-30 15:26:27 +0800
committerhaixin <haixin@inspur.com>2020-10-06 15:56:50 +0800
commit298c86f1e6f2c7e7feba63580b327542d40e8dad (patch)
treeb08e4c65985b592552e33c836bff54623ab97117 /oslo_policy/_checks.py
parent266ee36d3387247f8cbc57327a71f86a181fd45f (diff)
downloadoslo-policy-298c86f1e6f2c7e7feba63580b327542d40e8dad.tar.gz
Remove all usage of six library
Replace six with Python 3 style code. Change-Id: I3d0c35e237484409d8410601ec482fac0dacf30d
Diffstat (limited to 'oslo_policy/_checks.py')
-rw-r--r--oslo_policy/_checks.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/oslo_policy/_checks.py b/oslo_policy/_checks.py
index b7e7b91..c813af6 100644
--- a/oslo_policy/_checks.py
+++ b/oslo_policy/_checks.py
@@ -19,7 +19,6 @@ import abc
import ast
import inspect
-import six
import stevedore
if hasattr(inspect, 'getfullargspec'):
@@ -86,8 +85,7 @@ def _check(rule, target, creds, enforcer, current_rule):
return rule(*rule_args)
-@six.add_metaclass(abc.ABCMeta)
-class BaseCheck(object):
+class BaseCheck(metaclass=abc.ABCMeta):
"""Abstract base class for Check classes."""
@abc.abstractmethod
@@ -316,7 +314,7 @@ class GenericCheck(Check):
'''
if len(path_segments) == 0:
- return match == six.text_type(test_value)
+ return match == str(test_value)
key, path_segments = path_segments[0], path_segments[1:]
try:
test_value = test_value[key]
@@ -341,7 +339,7 @@ class GenericCheck(Check):
try:
# Try to interpret self.kind as a literal
test_value = ast.literal_eval(self.kind)
- return match == six.text_type(test_value)
+ return match == str(test_value)
except ValueError:
pass