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