summaryrefslogtreecommitdiff
path: root/novaclient/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/base.py')
-rw-r--r--novaclient/base.py25
1 files changed, 5 insertions, 20 deletions
diff --git a/novaclient/base.py b/novaclient/base.py
index 821e19bd..48c06f37 100644
--- a/novaclient/base.py
+++ b/novaclient/base.py
@@ -29,7 +29,6 @@ import threading
from oslo_utils import reflection
from oslo_utils import strutils
import requests
-import six
from novaclient import exceptions
from novaclient import utils
@@ -388,12 +387,9 @@ class Manager(HookableMixin):
return StrWithMeta(body, resp)
def convert_into_with_meta(self, item, resp):
- if isinstance(item, six.string_types):
- if six.PY2 and isinstance(item, six.text_type):
- return UnicodeWithMeta(item, resp)
- else:
- return StrWithMeta(item, resp)
- elif isinstance(item, six.binary_type):
+ if isinstance(item, str):
+ return StrWithMeta(item, resp)
+ elif isinstance(item, bytes):
return BytesWithMeta(item, resp)
elif isinstance(item, list):
return ListWithMeta(item, resp)
@@ -405,8 +401,7 @@ class Manager(HookableMixin):
return DictWithMeta(item, resp)
-@six.add_metaclass(abc.ABCMeta)
-class ManagerWithFind(Manager):
+class ManagerWithFind(Manager, metaclass=abc.ABCMeta):
"""Like a `Manager`, but with additional `find()`/`findall()` methods."""
@abc.abstractmethod
@@ -560,20 +555,10 @@ class StrWithMeta(str, RequestIdMixin):
self.append_request_ids(resp)
-class BytesWithMeta(six.binary_type, RequestIdMixin):
+class BytesWithMeta(bytes, RequestIdMixin):
def __new__(cls, value, resp):
return super(BytesWithMeta, cls).__new__(cls, value)
def __init__(self, values, resp):
self.request_ids_setup()
self.append_request_ids(resp)
-
-
-if six.PY2:
- class UnicodeWithMeta(six.text_type, RequestIdMixin):
- def __new__(cls, value, resp):
- return super(UnicodeWithMeta, cls).__new__(cls, value)
-
- def __init__(self, values, resp):
- self.request_ids_setup()
- self.append_request_ids(resp)