[Part 10] Remove all usage of six library
We don't need this in a Python 3-only world. Remove six in follows: 1. lower-constraints.txt 2. requirements.txt 3. zaqar/bench/observer.py 4. zaqar/common/api/api.py 5. zaqar/common/api/request.py 6. zaqar/common/api/response.py 7. zaqar/common/pipeline.py 8. zaqar/common/storage/select.py Change-Id: I8669061e00fd929c24e62ce9fd4ba31aab63e0d4
This commit is contained in:
parent
1726ac41b5
commit
963ef01c6f
@ -21,7 +21,7 @@ from gevent import monkey as curious_george
|
||||
curious_george.patch_all(thread=False, select=False)
|
||||
import gevent
|
||||
import marktime
|
||||
from six.moves import urllib
|
||||
import urllib
|
||||
from zaqarclient.transport import errors
|
||||
|
||||
from zaqar.bench import config
|
||||
|
@ -33,7 +33,7 @@ class Api(object):
|
||||
|
||||
:param action: Action for which params need
|
||||
to be validated.
|
||||
:type action: `six.text_type`
|
||||
:type action: `str`
|
||||
|
||||
:returns: Action's schema
|
||||
:rtype: dict
|
||||
@ -57,7 +57,7 @@ class Api(object):
|
||||
|
||||
:param action: Action's for which body need
|
||||
to be validated.
|
||||
:type action: `six.text_type`
|
||||
:type action: `str`
|
||||
:param body: Params to validate
|
||||
:type body: dict
|
||||
|
||||
|
@ -28,7 +28,7 @@ class Request(object):
|
||||
:param headers: Request headers. Default: None
|
||||
:type headers: dict
|
||||
:param api: Api entry point. i.e: 'queues.v1'
|
||||
:type api: `six.text_type`.
|
||||
:type api: `str`.
|
||||
:param env: Request environment. Default: None
|
||||
:type env: dict
|
||||
"""
|
||||
|
@ -24,7 +24,7 @@ class Response(object):
|
||||
:param request: The request sent to the server.
|
||||
:type request: `zaqar.transport.request.Request`
|
||||
:param body: Response's body
|
||||
:type body: `six.string_types`
|
||||
:type body: `str`
|
||||
:param headers: Optional headers returned in the response.
|
||||
:type headers: dict
|
||||
"""
|
||||
|
@ -32,7 +32,6 @@ them do, an AttributeError exception will be raised.
|
||||
import contextlib
|
||||
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from zaqar.common import decorators
|
||||
from zaqar.i18n import _
|
||||
@ -58,7 +57,7 @@ class Pipeline(object):
|
||||
for `method`.
|
||||
|
||||
:params method: The method name to call on each stage
|
||||
:type method: `six.text_type`
|
||||
:type method: `str`
|
||||
|
||||
:returns: A callable to consume the pipeline.
|
||||
"""
|
||||
@ -88,7 +87,7 @@ class Pipeline(object):
|
||||
try:
|
||||
target = getattr(stage, method)
|
||||
except AttributeError:
|
||||
sstage = six.text_type(stage)
|
||||
sstage = str(stage)
|
||||
msgtmpl = _(u"Stage %(stage)s does not "
|
||||
"implement %(method)s")
|
||||
LOG.debug(msgtmpl, {'stage': sstage, 'method': method})
|
||||
|
@ -25,7 +25,7 @@ def weighted(objs, key='weight', generator=random.randint):
|
||||
:param objs: a list of objects containing at least the field `key`
|
||||
:type objs: [dict]
|
||||
:param key: the field in each obj that corresponds to weight
|
||||
:type key: six.text_type
|
||||
:type key: str
|
||||
:param generator: a number generator taking two ints
|
||||
:type generator: function(int, int) -> int
|
||||
:return: an object
|
||||
|
Loading…
x
Reference in New Issue
Block a user