DRY applied to class names
Closes-bug: #1237747 We had some classes that contained part of the namespace in its name. This makes classes names unnecessarily verbose. Change-Id: I1a5c5be290437b6087cb57c63d9ea10826667f19
This commit is contained in:
parent
8faf500d4c
commit
518c34e9c7
@ -7,7 +7,7 @@ from marconi.queues.storage import errors # NOQA
|
||||
ControlDriverBase = base.ControlDriverBase
|
||||
DataDriverBase = base.DataDriverBase
|
||||
CatalogueBase = base.CatalogueBase
|
||||
ClaimBase = base.ClaimBase
|
||||
MessageBase = base.MessageBase
|
||||
QueueBase = base.QueueBase
|
||||
Claim = base.Claim
|
||||
Message = base.Message
|
||||
Queue = base.Queue
|
||||
ShardsBase = base.ShardsBase
|
||||
|
@ -138,7 +138,7 @@ class ControllerBase(object):
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class QueueBase(ControllerBase):
|
||||
class Queue(ControllerBase):
|
||||
"""This class is responsible for managing queues.
|
||||
|
||||
Queue operations include CRUD, monitoring, etc.
|
||||
@ -231,7 +231,7 @@ class QueueBase(ControllerBase):
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class MessageBase(ControllerBase):
|
||||
class Message(ControllerBase):
|
||||
"""This class is responsible for managing message CRUD."""
|
||||
|
||||
@abc.abstractmethod
|
||||
@ -347,7 +347,7 @@ class MessageBase(ControllerBase):
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class ClaimBase(ControllerBase):
|
||||
class Claim(ControllerBase):
|
||||
|
||||
@abc.abstractmethod
|
||||
def get(self, queue, claim_id, project=None):
|
||||
|
@ -35,7 +35,7 @@ from marconi.queues.storage.mongodb import utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ClaimController(storage.ClaimBase):
|
||||
class ClaimController(storage.Claim):
|
||||
"""Implements claim resource operations using MongoDB.
|
||||
|
||||
No dedicated collection is being used
|
||||
|
@ -108,7 +108,7 @@ TRANSACTION_INDEX_FIELDS = [
|
||||
]
|
||||
|
||||
|
||||
class MessageController(storage.MessageBase):
|
||||
class MessageController(storage.Message):
|
||||
"""Implements message resource operations using MongoDB.
|
||||
|
||||
Messages are scoped by project + queue.
|
||||
|
@ -34,7 +34,7 @@ from marconi.queues.storage.mongodb import utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class QueueController(storage.QueueBase):
|
||||
class QueueController(storage.Queue):
|
||||
"""Implements queue resource operations using MongoDB.
|
||||
|
||||
Queues are scoped by project, which is prefixed to the
|
||||
|
@ -18,7 +18,7 @@ from marconi.queues.storage import errors
|
||||
from marconi.queues.storage.sqlite import utils
|
||||
|
||||
|
||||
class ClaimController(base.ClaimBase):
|
||||
class ClaimController(base.Claim):
|
||||
|
||||
def get(self, queue, claim_id, project):
|
||||
if project is None:
|
||||
|
@ -19,7 +19,7 @@ from marconi.queues.storage import errors
|
||||
from marconi.queues.storage.sqlite import utils
|
||||
|
||||
|
||||
class MessageController(base.MessageBase):
|
||||
class MessageController(base.Message):
|
||||
|
||||
def get(self, queue, message_id, project):
|
||||
if project is None:
|
||||
|
@ -19,7 +19,7 @@ from marconi.queues.storage import errors
|
||||
from marconi.queues.storage.sqlite import utils
|
||||
|
||||
|
||||
class QueueController(base.QueueBase):
|
||||
class QueueController(base.Queue):
|
||||
|
||||
def list(self, project, marker=None,
|
||||
limit=None, detailed=False):
|
||||
|
@ -37,7 +37,7 @@ class Driver(driver.DriverBase):
|
||||
return [
|
||||
# Home
|
||||
('/',
|
||||
v1.V1Resource()),
|
||||
v1.Resource()),
|
||||
|
||||
# Queues Endpoints
|
||||
('/queues',
|
||||
|
@ -130,7 +130,7 @@ JSON_HOME = {
|
||||
}
|
||||
|
||||
|
||||
class V1Resource(object):
|
||||
class Resource(object):
|
||||
|
||||
def __init__(self):
|
||||
document = json.dumps(JSON_HOME, ensure_ascii=False, indent=4)
|
||||
|
@ -54,7 +54,7 @@ class ControlDriver(storage.ControlDriverBase):
|
||||
return None
|
||||
|
||||
|
||||
class QueueController(storage.QueueBase):
|
||||
class QueueController(storage.Queue):
|
||||
def __init__(self, driver):
|
||||
pass
|
||||
|
||||
@ -80,7 +80,7 @@ class QueueController(storage.QueueBase):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class MessageController(storage.MessageBase):
|
||||
class MessageController(storage.Message):
|
||||
def __init__(self, driver):
|
||||
pass
|
||||
|
||||
|
@ -74,7 +74,7 @@ class ControllerBaseTest(testing.TestBase):
|
||||
@ddt.ddt
|
||||
class QueueControllerTest(ControllerBaseTest):
|
||||
"""Queue Controller base tests."""
|
||||
controller_base_class = storage.QueueBase
|
||||
controller_base_class = storage.Queue
|
||||
|
||||
def setUp(self):
|
||||
super(QueueControllerTest, self).setUp()
|
||||
@ -224,7 +224,7 @@ class MessageControllerTest(ControllerBaseTest):
|
||||
to clean up storage's state.
|
||||
"""
|
||||
queue_name = 'test_queue'
|
||||
controller_base_class = storage.MessageBase
|
||||
controller_base_class = storage.Message
|
||||
|
||||
# Specifies how often expired messages are purged, in sec.
|
||||
gc_interval = 0
|
||||
@ -458,7 +458,7 @@ class ClaimControllerTest(ControllerBaseTest):
|
||||
to clean up storage's state.
|
||||
"""
|
||||
queue_name = 'test_queue'
|
||||
controller_base_class = storage.ClaimBase
|
||||
controller_base_class = storage.Claim
|
||||
|
||||
def setUp(self):
|
||||
super(ClaimControllerTest, self).setUp()
|
||||
|
Loading…
Reference in New Issue
Block a user