Merge "[Part2] Remove six"
This commit is contained in:
commit
82e6714627
@ -20,8 +20,8 @@ Serves to construct an association between a project + queue -> pool.
|
||||
::
|
||||
|
||||
{
|
||||
'p_q': project_queue :: six.text_type,
|
||||
's': pool_identifier :: six.text_type
|
||||
'p_q': project_queue :: str,
|
||||
's': pool_identifier :: str
|
||||
}
|
||||
"""
|
||||
|
||||
|
@ -14,9 +14,9 @@
|
||||
|
||||
"""
|
||||
Schema:
|
||||
'n': name :: six.text_type
|
||||
'p': project :: six.text_type
|
||||
's': storage pool_group :: six.text_type
|
||||
'n': name :: str
|
||||
'p': project :: str
|
||||
's': storage pool_group :: str
|
||||
'c': capabilities :: dict
|
||||
"""
|
||||
|
||||
|
@ -16,11 +16,11 @@
|
||||
controller for mongodb.
|
||||
|
||||
Schema:
|
||||
'n': name :: six.text_type
|
||||
'u': uri :: six.text_type
|
||||
'n': name :: str
|
||||
'u': uri :: str
|
||||
'w': weight :: int
|
||||
'o': options :: dict
|
||||
'f': flavor :: six.text_type
|
||||
'f': flavor :: str
|
||||
"""
|
||||
|
||||
import functools
|
||||
|
@ -42,12 +42,12 @@ class SubscriptionController(base.Subscription):
|
||||
Subscriptions are unique by project + queue/topic + subscriber.
|
||||
|
||||
Schema:
|
||||
's': source :: six.text_type
|
||||
'u': subscriber:: six.text_type
|
||||
's': source :: str
|
||||
'u': subscriber:: str
|
||||
't': ttl:: int
|
||||
'e': expires: datetime.datetime
|
||||
'o': options :: dict
|
||||
'p': project :: six.text_type
|
||||
'p': project :: str
|
||||
'c': confirmed :: boolean
|
||||
"""
|
||||
|
||||
|
@ -159,9 +159,9 @@ def scope_queue_name(queue=None, project=None):
|
||||
specified, a scope for "all global queues" is returned, which
|
||||
is to be interpreted as excluding queues scoped by project.
|
||||
:param queue: name of queue to seek
|
||||
:type queue: six.text_type
|
||||
:type queue: str
|
||||
:param project: namespace
|
||||
:type project: six.text_type
|
||||
:type project: str
|
||||
:returns: '{project}/{queue}' if project and queue are given,
|
||||
'{project}/' if ONLY project is given, '/{queue}' if ONLY
|
||||
queue is given, and '/' if neither are given.
|
||||
@ -184,9 +184,9 @@ def parse_scoped_project_queue(scoped_name):
|
||||
"""Returns the project and queue name for a scoped catalogue entry.
|
||||
|
||||
:param scoped_name: a project/queue as given by :scope_queue_name:
|
||||
:type scoped_name: six.text_type
|
||||
:type scoped_name: str
|
||||
:returns: (project, queue)
|
||||
:rtype: (six.text_type, six.text_type)
|
||||
:rtype: (str, six.text_type)
|
||||
"""
|
||||
return scoped_name.split('/')
|
||||
|
||||
@ -196,9 +196,9 @@ def scoped_query(queue, project, name=None, kfilter={},
|
||||
"""Returns a dict usable for querying for scoped project/queues.
|
||||
|
||||
:param queue: name of queue to seek
|
||||
:type queue: six.text_type
|
||||
:type queue: str
|
||||
:param project: namespace
|
||||
:type project: six.text_type
|
||||
:type project: str
|
||||
:returns: query to issue
|
||||
:rtype: dict
|
||||
"""
|
||||
|
@ -466,7 +466,7 @@ class Catalog(object):
|
||||
"""Given a pool name, returns a storage driver.
|
||||
|
||||
:param pool_id: The name of a pool.
|
||||
:type pool_id: six.text_type
|
||||
:type pool_id: str
|
||||
:returns: a storage driver
|
||||
:rtype: zaqar.storage.base.DataDriverBase
|
||||
"""
|
||||
@ -507,12 +507,12 @@ class Catalog(object):
|
||||
queue's assigned backend pool.
|
||||
|
||||
:param queue: Name of the new queue to assign to a pool
|
||||
:type queue: six.text_type
|
||||
:type queue: str
|
||||
:param project: Project to which the queue belongs, or
|
||||
None for the "global" or "generic" project.
|
||||
:type project: six.text_type
|
||||
:type project: str
|
||||
:param flavor: Flavor for the queue (OPTIONAL)
|
||||
:type flavor: six.text_type
|
||||
:type flavor: str
|
||||
|
||||
:raises NoPoolFound: if not found
|
||||
|
||||
@ -582,10 +582,10 @@ class Catalog(object):
|
||||
backend pool.
|
||||
|
||||
:param queue: Name of the new queue to assign to a pool
|
||||
:type queue: six.text_type
|
||||
:type queue: str
|
||||
:param project: Project to which the queue belongs, or
|
||||
None for the "global" or "generic" project.
|
||||
:type project: six.text_type
|
||||
:type project: str
|
||||
"""
|
||||
self._catalogue_ctrl.delete(project, queue)
|
||||
|
||||
@ -727,7 +727,7 @@ class Catalog(object):
|
||||
"""Get storage driver, preferably cached, from a pool name.
|
||||
|
||||
:param pool_id: The name of a pool.
|
||||
:type pool_id: six.text_type
|
||||
:type pool_id: str
|
||||
:returns: a storage driver
|
||||
:rtype: zaqar.storage.base.DataDriver
|
||||
"""
|
||||
|
@ -20,13 +20,12 @@ Serves to construct an association between a project + queue -> pool.
|
||||
::
|
||||
|
||||
{
|
||||
'p_q': project_queue :: six.text_type,
|
||||
's': pool_identifier :: six.text_type
|
||||
'p_q': project_queue :: str,
|
||||
's': pool_identifier :: str
|
||||
}
|
||||
"""
|
||||
from oslo_log import log as logging
|
||||
import redis
|
||||
import six
|
||||
|
||||
from zaqar.i18n import _
|
||||
from zaqar.storage import base
|
||||
@ -241,7 +240,7 @@ class CatalogueController(base.CatalogueBase):
|
||||
|
||||
def _normalize(entry):
|
||||
return {
|
||||
'queue': six.text_type(entry['p_q']),
|
||||
'project': six.text_type(entry['p']),
|
||||
'pool': six.text_type(entry['p_p'])
|
||||
'queue': str(entry['p_q']),
|
||||
'project': str(entry['p']),
|
||||
'pool': str(entry['p_p'])
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
from osprofiler import profiler
|
||||
import redis
|
||||
import redis.sentinel
|
||||
from six.moves import urllib
|
||||
import urllib
|
||||
|
||||
from zaqar.common import decorators
|
||||
from zaqar.common import errors
|
||||
|
@ -16,8 +16,8 @@
|
||||
controller for redis.
|
||||
|
||||
Schema:
|
||||
'n': name :: six.text_type
|
||||
'u': uri :: six.text_type
|
||||
'n': name :: str
|
||||
'u': uri :: str
|
||||
'w': weight :: int
|
||||
'o': options :: dict
|
||||
"""
|
||||
|
@ -39,12 +39,12 @@ class SubscriptionController(base.Subscription):
|
||||
Subscriptions are unique by project + queue + subscriber.
|
||||
|
||||
Schema:
|
||||
's': source :: six.text_type
|
||||
'u': subscriber:: six.text_type
|
||||
's': source :: str
|
||||
'u': subscriber:: str
|
||||
't': ttl:: int
|
||||
'e': expires: int
|
||||
'o': options :: dict
|
||||
'p': project :: six.text_type
|
||||
'p': project :: str
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SubscriptionController, self).__init__(*args, **kwargs)
|
||||
|
@ -21,7 +21,6 @@ import time
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import encodeutils
|
||||
import redis
|
||||
import six
|
||||
|
||||
from zaqar.storage import errors
|
||||
|
||||
@ -231,7 +230,7 @@ def msg_delayed_filter(message, now):
|
||||
def msg_echo_filter(message, client_uuid):
|
||||
"""Return True IFF the specified client posted the message."""
|
||||
|
||||
return message.client_uuid == six.text_type(client_uuid)
|
||||
return message.client_uuid == str(client_uuid)
|
||||
|
||||
|
||||
def msg_expired_filter(message, now):
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
import logging
|
||||
from osprofiler import profiler
|
||||
from six.moves import urllib
|
||||
import urllib
|
||||
|
||||
from keystoneauth1.identity import generic
|
||||
from keystoneauth1 import session as keystone_session
|
||||
|
Loading…
x
Reference in New Issue
Block a user