Remove six

This wasn't actually recorded in our list of dependencies, but we were
using it all the same. In any case, it's no longer necessary so remove
it.

Change-Id: Ia29fdf5058c2b22327cb0ba16c28bef3660e9ceb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2021-12-21 11:35:00 +00:00
parent 051476b84c
commit 7f7b9d921e
4 changed files with 11 additions and 14 deletions

View File

@ -25,7 +25,6 @@ import socket
import threading
import msgpack
import six
from oslo_privsep._i18n import _
@ -62,7 +61,7 @@ class Serializer(object):
self.writesock.shutdown(socket.SHUT_WR)
class Deserializer(six.Iterator):
class Deserializer(object):
def __init__(self, readsock):
self.readsock = readsock
self.unpacker = msgpack.Unpacker(use_list=False, raw=False,
@ -182,7 +181,7 @@ class ClientChannel(object):
self.reader_thread.join()
class ServerChannel(six.Iterator):
class ServerChannel(object):
"""Server-side twin to ClientChannel"""
def __init__(self, sock):

View File

@ -62,7 +62,6 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import importutils
import six
from oslo_privsep._i18n import _
from oslo_privsep import capabilities
@ -521,8 +520,8 @@ class Daemon(object):
reply = (Message.ERR.value, cls_name, e.args)
try:
channel.send((msgid, reply))
except IOError:
self.communication_error = sys.exc_info()
except IOError as exc:
self.communication_error = exc
return _call_back
@ -537,10 +536,10 @@ class Daemon(object):
for msgid, msg in self.channel:
error = self.communication_error
if error:
if error[1].errno == errno.EPIPE:
if error.errno == errno.EPIPE:
# Write stream closed, exit loop
break
six.reraise(*error)
raise error
# Submit the command for execution
future = self.thread_pool.submit(self._process_cmd, msgid, *msg)

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
import io
from oslotest import base
@ -22,7 +22,7 @@ from oslo_privsep import comm
class BufSock(object):
def __init__(self):
self.readpos = 0
self.buf = six.BytesIO()
self.buf = io.BytesIO()
def recv(self, bufsize):
if self.buf.closed:

View File

@ -25,7 +25,6 @@ from unittest import mock
from oslo_log import formatters
from oslo_log import log as logging
from oslotest import base
import six
import testtools
from oslo_privsep import capabilities
@ -189,12 +188,12 @@ class WithContextTest(testctx.TestContextTestCase):
class ClientChannelTestCase(base.BaseTestCase):
DICT = {
'string_1': ('tuple_1', six.b('tuple_2')),
six.b('byte_1'): ['list_1', 'list_2'],
'string_1': ('tuple_1', b'tuple_2'),
b'byte_1': ['list_1', 'list_2'],
}
EXPECTED = {
'string_1': ('tuple_1', six.b('tuple_2')),
'string_1': ('tuple_1', b'tuple_2'),
'byte_1': ['list_1', 'list_2'],
}