[Part7] Remove six

We don't need this in a Python 3-only world.

Remove six in follows:
1. zaqar/transport/base.py
2. zaqar/transport/middleware/cors.py
3. zaqar/transport/middleware/profile.py
4. zaqar/transport/validation.py
5. zaqar/transport/wsgi/driver.py

Change-Id: I0cd64879265f8657322d02f7e9048ed338fe2cf7
This commit is contained in:
melissaml 2020-10-14 21:49:33 +08:00
parent 20fabeb0b5
commit be65fb98d5
5 changed files with 6 additions and 10 deletions

@ -15,8 +15,6 @@
import abc
import six
from zaqar.conf import default
from zaqar.conf import transport
@ -47,8 +45,7 @@ class ResourceDefaults(object):
return self._defaults.default_subscription_ttl
@six.add_metaclass(abc.ABCMeta)
class DriverBase(object):
class DriverBase(object, metaclass=abc.ABCMeta):
"""Base class for Transport Drivers to document the expected interface.
:param conf: configuration instance

@ -12,7 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import six.moves.urllib.parse as urlparse
from urllib import parse as urlparse
import webob
from oslo_log import log

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six.moves.urllib.parse as urlparse
from urllib import parse as urlparse
import webob
from oslo_log import log

@ -19,7 +19,7 @@ import re
import uuid
from oslo_utils import timeutils
import six
from urllib import parse as urllib_parse
from zaqar.common import consts
from zaqar.conf import transport
@ -569,7 +569,7 @@ class Validator(object):
subscriber_type = None
if subscriber:
parsed_uri = six.moves.urllib_parse.urlparse(subscriber)
parsed_uri = urllib_parse.urlparse(subscriber)
subscriber_type = parsed_uri.scheme
if subscriber_type not in self._limits_conf.subscriber_types:

@ -15,7 +15,6 @@
from distutils import version as d_version
import falcon
import six
import socket
from wsgiref import simple_server
@ -169,7 +168,7 @@ class Driver(transport.DriverBase):
raise
LOG.exception('Internal server error')
raise falcon.HTTPInternalServerError('Internal server error',
six.text_type(exc))
str(exc))
def _get_server_cls(self, host):
"""Return an appropriate WSGI server class base on provided host