Change Marconi's codebase structure

This patch re-structures Marconi's codebase in a way that it'll be
possible to add other services such as marconi-proxy and
marconi-notification as standalone services within Marconi.

Implements blueprint change-marconi-structure

Change-Id: Id6061f04ec6e6959143fb0f5905bb8799fd86edd
This commit is contained in:
Flavio Percoco 2013-09-17 14:47:47 +02:00
parent 443acec894
commit 9b6350afa5
50 changed files with 110 additions and 110 deletions

View File

@ -22,8 +22,8 @@ try:
except NameError: except NameError:
import gettext import gettext
gettext.install('marconi', unicode=1) gettext.install('marconi', unicode=1)
import marconi.bootstrap import marconi.queues.bootstrap
Bootstrap = marconi.bootstrap.Bootstrap Bootstrap = marconi.queues.bootstrap.Bootstrap
import marconi.version import marconi.version

View File

View File

@ -19,7 +19,7 @@ from marconi.common import config
from marconi.common import decorators from marconi.common import decorators
from marconi.common import exceptions from marconi.common import exceptions
from marconi.openstack.common import log from marconi.openstack.common import log
from marconi import transport # NOQA from marconi.queues import transport # NOQA
PROJECT_CFG = config.project('marconi') PROJECT_CFG = config.project('marconi')

View File

@ -1,7 +1,7 @@
"""Marconi Storage Drivers""" """Marconi Storage Drivers"""
from marconi.storage import base from marconi.queues.storage import base
from marconi.storage import exceptions # NOQA from marconi.queues.storage import exceptions # NOQA
# Hoist classes into package namespace # Hoist classes into package namespace

View File

@ -1,6 +1,6 @@
"""MongoDB Storage Driver for Marconi""" """MongoDB Storage Driver for Marconi"""
from marconi.storage.mongodb import driver from marconi.queues.storage.mongodb import driver
# Hoist classes into package namespace # Hoist classes into package namespace
Driver = driver.Driver Driver = driver.Driver

View File

@ -26,9 +26,9 @@ from bson import objectid
from marconi.common import config from marconi.common import config
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi import storage from marconi.queues import storage
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.mongodb import utils from marconi.queues.storage.mongodb import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(

View File

@ -22,9 +22,9 @@ Field Mappings:
updated and documented in each controller class. updated and documented in each controller class.
""" """
from marconi.storage.mongodb import claims from marconi.queues.storage.mongodb import claims
from marconi.storage.mongodb import messages from marconi.queues.storage.mongodb import messages
from marconi.storage.mongodb import queues from marconi.queues.storage.mongodb import queues
ClaimController = claims.ClaimController ClaimController = claims.ClaimController
MessageController = messages.MessageController MessageController = messages.MessageController

View File

@ -19,9 +19,9 @@ import pymongo
import pymongo.errors import pymongo.errors
from marconi.openstack.common import log as logging from marconi.openstack.common import log as logging
from marconi import storage from marconi.queues import storage
from marconi.storage.mongodb import controllers from marconi.queues.storage.mongodb import controllers
from marconi.storage.mongodb import options from marconi.queues.storage.mongodb import options
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -29,10 +29,10 @@ import pymongo.read_preferences
from marconi.common import config from marconi.common import config
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi import storage from marconi.queues import storage
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.mongodb import options from marconi.queues.storage.mongodb import options
from marconi.storage.mongodb import utils from marconi.queues.storage.mongodb import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(

View File

@ -26,9 +26,9 @@ import pymongo.errors
from marconi.common import config from marconi.common import config
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi import storage from marconi.queues import storage
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.mongodb import utils from marconi.queues.storage.mongodb import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(

View File

@ -27,7 +27,7 @@ from pymongo import errors
from marconi.common import exceptions from marconi.common import exceptions
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi.storage import exceptions as storage_exceptions from marconi.queues.storage import exceptions as storage_exceptions
DUP_MARKER_REGEX = re.compile(r'\$queue_marker.*?:\s(\d+)') DUP_MARKER_REGEX = re.compile(r'\$queue_marker.*?:\s(\d+)')

View File

@ -4,7 +4,7 @@ In-memory reference Storage Driver for Marconi.
Useful for automated testing and for prototyping storage driver concepts. Useful for automated testing and for prototyping storage driver concepts.
""" """
from marconi.storage.sqlite import driver from marconi.queues.storage.sqlite import driver
# Hoist classes into package namespace # Hoist classes into package namespace
Driver = driver.Driver Driver = driver.Driver

View File

@ -14,9 +14,9 @@
# limitations under the License. # limitations under the License.
from marconi.common import config from marconi.common import config
from marconi.storage import base from marconi.queues.storage import base
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.sqlite import utils from marconi.queues.storage.sqlite import utils
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(
default_message_paging=10, default_message_paging=10,

View File

@ -16,9 +16,9 @@
"""Exports SQLite driver controllers.""" """Exports SQLite driver controllers."""
from marconi.storage.sqlite import claims from marconi.queues.storage.sqlite import claims
from marconi.storage.sqlite import messages from marconi.queues.storage.sqlite import messages
from marconi.storage.sqlite import queues from marconi.queues.storage.sqlite import queues
ClaimController = claims.ClaimController ClaimController = claims.ClaimController
MessageController = messages.MessageController MessageController = messages.MessageController

View File

@ -19,9 +19,9 @@ import sqlite3
import msgpack import msgpack
from marconi.common import config from marconi.common import config
from marconi import storage from marconi.queues import storage
from marconi.storage.sqlite import controllers from marconi.queues.storage.sqlite import controllers
from marconi.storage.sqlite import utils from marconi.queues.storage.sqlite import utils
CFG = config.namespace('drivers:storage:sqlite').from_options( CFG = config.namespace('drivers:storage:sqlite').from_options(
database=':memory:') database=':memory:')

View File

@ -15,9 +15,9 @@
from marconi.common import config from marconi.common import config
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi.storage import base from marconi.queues.storage import base
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.sqlite import utils from marconi.queues.storage.sqlite import utils
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(
default_message_paging=10, default_message_paging=10,

View File

@ -15,9 +15,9 @@
# limitations under the License. # limitations under the License.
from marconi.common import config from marconi.common import config
from marconi.storage import base from marconi.queues.storage import base
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi.storage.sqlite import utils from marconi.queues.storage.sqlite import utils
CFG = config.namespace('limits:storage').from_options( CFG = config.namespace('limits:storage').from_options(
default_queue_paging=10, default_queue_paging=10,

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from marconi.storage import exceptions from marconi.queues.storage import exceptions
UNIX_EPOCH_AS_JULIAN_SEC = 2440587.5 * 86400.0 UNIX_EPOCH_AS_JULIAN_SEC = 2440587.5 * 86400.0

View File

@ -1,7 +1,7 @@
"""Marconi Transport Drivers""" """Marconi Transport Drivers"""
from marconi.common import config from marconi.common import config
from marconi.transport import base from marconi.queues.transport import base
OPTIONS = { OPTIONS = {
'auth_strategy': "" 'auth_strategy': ""

View File

@ -0,0 +1,11 @@
"""WSGI Transport Driver"""
from marconi.queues.transport.wsgi import claims # NOQA
from marconi.queues.transport.wsgi import driver
from marconi.queues.transport.wsgi import messages # NOQA
from marconi.queues.transport.wsgi import queues # NOQA
from marconi.queues.transport.wsgi import stats # NOQA
# Hoist into package namespace
Driver = driver.Driver

View File

@ -26,6 +26,6 @@ no common way to specify / pass configuration files
to the WSGI app when it is called from other apps. to the WSGI app when it is called from other apps.
""" """
from marconi import bootstrap from marconi.queues import bootstrap
app = bootstrap.Bootstrap().transport.app app = bootstrap.Bootstrap().transport.app

View File

@ -18,11 +18,11 @@ import falcon
from marconi.common import config from marconi.common import config
from marconi.common import exceptions as input_exceptions from marconi.common import exceptions as input_exceptions
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.storage import exceptions as storage_exceptions from marconi.queues.storage import exceptions as storage_exceptions
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport import validation as validate from marconi.queues.transport import validation as validate
from marconi.transport.wsgi import exceptions as wsgi_exceptions from marconi.queues.transport.wsgi import exceptions as wsgi_exceptions
from marconi.transport.wsgi import utils as wsgi_utils from marconi.queues.transport.wsgi import utils as wsgi_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,15 +18,15 @@ from wsgiref import simple_server
from marconi.common import config from marconi.common import config
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi import transport from marconi.queues import transport
from marconi.transport import auth from marconi.queues.transport import auth
from marconi.transport.wsgi import claims from marconi.queues.transport.wsgi import claims
from marconi.transport.wsgi import health from marconi.queues.transport.wsgi import health
from marconi.transport.wsgi import messages from marconi.queues.transport.wsgi import messages
from marconi.transport.wsgi import metadata from marconi.queues.transport.wsgi import metadata
from marconi.transport.wsgi import queues from marconi.queues.transport.wsgi import queues
from marconi.transport.wsgi import stats from marconi.queues.transport.wsgi import stats
from marconi.transport.wsgi import v1 from marconi.queues.transport.wsgi import v1
OPTIONS = { OPTIONS = {
'bind': '0.0.0.0', 'bind': '0.0.0.0',

View File

@ -17,11 +17,11 @@ import falcon
from marconi.common import config from marconi.common import config
from marconi.common import exceptions as input_exceptions from marconi.common import exceptions as input_exceptions
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.storage import exceptions as storage_exceptions from marconi.queues.storage import exceptions as storage_exceptions
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport import validation as validate from marconi.queues.transport import validation as validate
from marconi.transport.wsgi import exceptions as wsgi_exceptions from marconi.queues.transport.wsgi import exceptions as wsgi_exceptions
from marconi.transport.wsgi import utils as wsgi_utils from marconi.queues.transport.wsgi import utils as wsgi_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,11 +18,11 @@ import falcon
from marconi.common import config from marconi.common import config
from marconi.common import exceptions as input_exceptions from marconi.common import exceptions as input_exceptions
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.storage import exceptions as storage_exceptions from marconi.queues.storage import exceptions as storage_exceptions
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport import validation as validate from marconi.queues.transport import validation as validate
from marconi.transport.wsgi import exceptions as wsgi_exceptions from marconi.queues.transport.wsgi import exceptions as wsgi_exceptions
from marconi.transport.wsgi import utils as wsgi_utils from marconi.queues.transport.wsgi import utils as wsgi_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -17,9 +17,9 @@ import falcon
from marconi.common import exceptions as input_exceptions from marconi.common import exceptions as input_exceptions
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport import validation as validate from marconi.queues.transport import validation as validate
from marconi.transport.wsgi import exceptions as wsgi_exceptions from marconi.queues.transport.wsgi import exceptions as wsgi_exceptions
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -16,9 +16,9 @@
import falcon import falcon
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.storage import exceptions as storage_exceptions from marconi.queues.storage import exceptions as storage_exceptions
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport.wsgi import exceptions as wsgi_exceptions from marconi.queues.transport.wsgi import exceptions as wsgi_exceptions
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -16,8 +16,8 @@
import marconi.openstack.common.log as logging import marconi.openstack.common.log as logging
from marconi.transport import utils from marconi.queues.transport import utils
from marconi.transport.wsgi import exceptions from marconi.queues.transport.wsgi import exceptions
JSONObject = dict JSONObject = dict

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
from marconi import storage from marconi.queues import storage
class Driver(storage.DriverBase): class Driver(storage.DriverBase):

View File

@ -17,15 +17,15 @@
import abc import abc
import multiprocessing import multiprocessing
from marconi import bootstrap from marconi.queues import bootstrap
# NOTE(flaper87): This is necessary to register,
# wsgi configs and won't be permanent. It'll be
# refactored as part of the work for this blueprint
from marconi.queues.transport import wsgi # noqa
from marconi import tests as testing from marconi import tests as testing
from marconi.tests.functional import config from marconi.tests.functional import config
from marconi.tests.functional import helpers from marconi.tests.functional import helpers
from marconi.tests.functional import http from marconi.tests.functional import http
# NOTE(flaper87): This is necessary to register,
# wsgi configs and won't be permanent. It'll be
# refactored as part of the work for this blueprint
from marconi.transport import wsgi # noqa
class FunctionalTestBase(testing.TestBase): class FunctionalTestBase(testing.TestBase):

View File

@ -1,11 +0,0 @@
"""WSGI Transport Driver"""
from marconi.transport.wsgi import claims # NOQA
from marconi.transport.wsgi import driver
from marconi.transport.wsgi import messages # NOQA
from marconi.transport.wsgi import queues # NOQA
from marconi.transport.wsgi import stats # NOQA
# Hoist into package namespace
Driver = driver.Driver

View File

@ -31,11 +31,11 @@ console_scripts =
marconi-server = marconi.cmd.server:run marconi-server = marconi.cmd.server:run
marconi.storage = marconi.storage =
sqlite = marconi.storage.sqlite.driver:Driver sqlite = marconi.queues.storage.sqlite.driver:Driver
mongodb = marconi.storage.mongodb.driver:Driver mongodb = marconi.queues.storage.mongodb.driver:Driver
marconi.transport = marconi.transport =
wsgi = marconi.transport.wsgi.driver:Driver wsgi = marconi.queues.transport.wsgi.driver:Driver
marconi.common.cache.backends = marconi.common.cache.backends =
memory = marconi.common.cache._backends.memory:MemoryBackend memory = marconi.common.cache._backends.memory:MemoryBackend

View File

@ -18,8 +18,8 @@ import time
from testtools import matchers from testtools import matchers
from marconi.openstack.common import timeutils from marconi.openstack.common import timeutils
from marconi import storage from marconi.queues import storage
from marconi.storage import exceptions from marconi.queues.storage import exceptions
from marconi import tests as testing from marconi import tests as testing

View File

@ -22,11 +22,11 @@ import pymongo.errors
from testtools import matchers from testtools import matchers
from marconi.common import exceptions from marconi.common import exceptions
from marconi import storage from marconi.queues import storage
from marconi.storage import mongodb from marconi.queues.storage import mongodb
from marconi.storage.mongodb import controllers from marconi.queues.storage.mongodb import controllers
from marconi.storage.mongodb import options as mongodb_options from marconi.queues.storage.mongodb import options as mongodb_options
from marconi.storage.mongodb import utils from marconi.queues.storage.mongodb import utils
from marconi import tests as testing from marconi import tests as testing
import base # noqa # noqa import base # noqa # noqa

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from marconi import storage from marconi.queues import storage
from marconi.storage import sqlite from marconi.queues.storage import sqlite
from marconi.storage.sqlite import controllers from marconi.queues.storage.sqlite import controllers
import base # noqa import base # noqa

View File

@ -15,11 +15,11 @@
from oslo.config import cfg from oslo.config import cfg
import marconi
from marconi.common import exceptions from marconi.common import exceptions
from marconi.storage import sqlite import marconi.queues
from marconi.queues.storage import sqlite
from marconi.queues.transport import wsgi
from marconi.tests import base from marconi.tests import base
from marconi.transport import wsgi
class TestBootstrap(base.TestBase): class TestBootstrap(base.TestBase):

View File

@ -17,8 +17,8 @@
from oslo.config import cfg from oslo.config import cfg
from marconi.common import config from marconi.common import config
from marconi.queues.transport import auth
from marconi import tests as testing from marconi import tests as testing
from marconi.transport import auth
class TestTransportAuth(testing.TestBase): class TestTransportAuth(testing.TestBase):

View File

@ -16,7 +16,7 @@
from falcon import testing as ftest from falcon import testing as ftest
import marconi import marconi.queues
from marconi import tests as testing from marconi import tests as testing
from marconi.tests import faulty_storage from marconi.tests import faulty_storage

View File

@ -20,7 +20,7 @@ import falcon
import json import json
import testtools import testtools
from marconi.transport.wsgi import utils from marconi.queues.transport.wsgi import utils
class TestWSGIutils(testtools.TestCase): class TestWSGIutils(testtools.TestCase):