Cleans up marconi-queues and marconi-proxy config files

Changes [proxy:config] and [queues:config] into
just [drivers] since both these projects are
separate and so there's less repetition.

Change-Id: I982b5a08ed45426df17d9008854853c68c207608
Closes-Bug:#1231669
This commit is contained in:
cpallares 2013-11-21 13:14:57 -06:00
parent a153d5b88a
commit c8e3a089d6
28 changed files with 60 additions and 60 deletions

View File

@ -26,18 +26,18 @@ log_file = /var/log/marconi/proxy.log
# Transport driver module (e.g., wsgi, zmq)
# Storage driver module (e.g., mongodb, sqlite)
[proxy:drivers]
[drivers]
transport = wsgi
storage = mongodb
[proxy:drivers:transport:wsgi]
[drivers:transport:wsgi]
;bind = 0.0.0.0
;port = 8889
[proxy:drivers:storage:mongodb]
[drivers:storage:mongodb]
uri = mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test&ssl=true&w=majority
database = marconi_proxy
[oslo_cache]
;cache_backend = memcached
;cache_prefix = my_namespace
;cache_prefix = my_namespace

View File

@ -31,7 +31,7 @@ log_file = /var/log/marconi/queues.log
# ================= Driver Options ============================
[queues:drivers]
[drivers]
# Transport driver module (e.g., wsgi, zmq)
transport = wsgi
@ -47,7 +47,7 @@ storage = mongodb
# Pipeline for operations on claim resources
;claim_pipeline =
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
;bind = 0.0.0.0
;port = 8888
@ -56,10 +56,10 @@ storage = mongodb
;metadata_max_length = 65536
;content_max_length = 262144
;[queues:drivers:transport:zmq]
;[drivers:transport:zmq]
;port = 9999
[queues:drivers:storage:mongodb]
[drivers:storage:mongodb]
uri = mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test&ssl=true&w=majority
database = marconi
@ -83,7 +83,7 @@ database = marconi
# at the same instant.
;max_retry_jitter = 0.005
[queues:limits:transport]
[limits:transport]
# The maximum number of queue records per page when listing queues
;queue_paging_uplimit = 20
@ -102,7 +102,7 @@ database = marconi
;metadata_size_uplimit = 65536
;message_size_uplimit = 262144
[queues:limits:storage]
[limits:storage]
# The default number of queue records per page when listing queues
;default_queue_paging = 10

View File

@ -32,7 +32,7 @@ _bootstrap_options = [
]
CFG = cfg.CONF
CFG.register_opts(_bootstrap_options, group="proxy:drivers")
CFG.register_opts(_bootstrap_options, group="drivers")
LOG = log.getLogger(__name__)
@ -63,7 +63,7 @@ class Bootstrap(object):
LOG.debug(_(u'Loading Proxy Storage Driver'))
try:
mgr = driver.DriverManager('marconi.proxy.storage',
CFG['proxy:drivers'].storage,
CFG['drivers'].storage,
invoke_on_load=True)
return mgr.driver
except RuntimeError as exc:
@ -85,7 +85,7 @@ class Bootstrap(object):
LOG.debug(_(u'Loading Proxy Transport Driver'))
try:
mgr = driver.DriverManager(self._transport_type,
CFG['proxy:drivers'].transport,
CFG['drivers'].transport,
invoke_on_load=True,
invoke_args=[self.storage,
self.cache])

View File

@ -27,6 +27,6 @@ _MONGODB_OPTIONS = [
cfg.StrOpt('database', default='marconi_proxy', help='Database name'),
]
_GROUP = 'proxy:drivers:storage:mongodb'
_GROUP = 'drivers:storage:mongodb'
cfg.CONF.register_opts(_MONGODB_OPTIONS, group=_GROUP)
CFG = cfg.CONF[_GROUP]

View File

@ -41,10 +41,10 @@ _WSGI_OPTIONS = [
cfg.CONF.register_opt(cfg.StrOpt('auth_strategy', default=''))
cfg.CONF.register_opts(_WSGI_OPTIONS,
group='proxy:drivers:transport:wsgi')
group='drivers:transport:wsgi')
GLOBAL_CFG = cfg.CONF
WSGI_CFG = cfg.CONF['proxy:drivers:transport:wsgi']
WSGI_CFG = cfg.CONF['drivers:transport:wsgi']
LOG = logging.getLogger(__name__)

View File

@ -44,7 +44,7 @@ _DRIVER_OPTIONS = [
help='Storage driver to use'),
]
_DRIVER_GROUP = 'queues:drivers'
_DRIVER_GROUP = 'drivers'
class Bootstrap(object):

View File

@ -28,7 +28,7 @@ _LIMITS_OPTIONS = [
help='Default message pagination size')
]
_LIMITS_GROUP = 'queues:limits:storage'
_LIMITS_GROUP = 'limits:storage'
@six.add_metaclass(abc.ABCMeta)

View File

@ -53,4 +53,4 @@ MONGODB_OPTIONS = [
'same instant.')),
]
MONGODB_GROUP = 'queues:drivers:storage:mongodb'
MONGODB_GROUP = 'drivers:storage:mongodb'

View File

@ -29,7 +29,7 @@ _CATALOG_OPTIONS = [
help='Catalog storage driver'),
]
_CATALOG_GROUP = 'queues:sharding:catalog'
_CATALOG_GROUP = 'sharding:catalog'
class DataDriver(storage.DataDriverBase):
@ -299,23 +299,23 @@ class Catalog(object):
general_dict_opts = {'dynamic': True}
general_opts = common_utils.dict_to_conf(general_dict_opts)
# NOTE(cpp-cabrera): parse general opts: 'queues:drivers'
# NOTE(cpp-cabrera): parse general opts: 'drivers'
uri = shard['uri']
storage_type = six.moves.urllib_parse.urlparse(uri).scheme
driver_dict_opts = {'storage': storage_type}
driver_opts = common_utils.dict_to_conf(driver_dict_opts)
# NOTE(cpp-cabrera): parse storage-specific opts:
# 'queues:drivers:storage:{type}'
# 'drivers:storage:{type}'
storage_dict_opts = shard['options']
storage_dict_opts['uri'] = shard['uri']
storage_opts = common_utils.dict_to_conf(storage_dict_opts)
storage_group = u'queues:drivers:storage:%s' % storage_type
storage_group = u'drivers:storage:%s' % storage_type
# NOTE(cpp-cabrera): register those options!
conf = cfg.ConfigOpts()
conf.register_opts(general_opts)
conf.register_opts(driver_opts, group=u'queues:drivers')
conf.register_opts(driver_opts, group=u'drivers')
conf.register_opts(storage_opts, group=storage_group)
return utils.load_storage_driver(conf)

View File

@ -31,7 +31,7 @@ _SQLITE_OPTIONS = [
help='Sqlite database to use.')
]
_SQLITE_GROUP = 'queues:drivers:storage:sqlite'
_SQLITE_GROUP = 'drivers:storage:sqlite'
class DataDriver(storage.DataDriverBase):

View File

@ -28,14 +28,14 @@ def load_storage_driver(conf, control_mode=False):
The driver's initializer will be passed conf as its only arg.
:param conf: Configuration instance to use for loading the
driver. Must include a 'queues:drivers' group.
driver. Must include a 'drivers' group.
"""
mode = 'control' if control_mode else 'data'
driver_type = 'marconi.queues.{0}.storage'.format(mode)
try:
mgr = driver.DriverManager(driver_type,
conf['queues:drivers'].storage,
conf['drivers'].storage,
invoke_on_load=True,
invoke_args=[conf])
return mgr.driver

View File

@ -29,7 +29,7 @@ _TRANSPORT_LIMITS_OPTIONS = [
cfg.IntOpt('claim_grace_max', default=43200),
]
_TRANSPORT_LIMITS_GROUP = 'queues:limits:transport'
_TRANSPORT_LIMITS_GROUP = 'limits:transport'
# NOTE(kgriffs): Don't use \w because it isn't guaranteed to match
# only ASCII characters.

View File

@ -39,7 +39,7 @@ _WSGI_OPTIONS = [
cfg.IntOpt('metadata_max_length', default=64 * 1024)
]
_WSGI_GROUP = 'queues:drivers:transport:wsgi'
_WSGI_GROUP = 'drivers:transport:wsgi'
LOG = logging.getLogger(__name__)

View File

@ -3,9 +3,9 @@ debug = False
verbose = False
admin_mode = False
[queues:drivers]
[drivers]
transport = wsgi
storage = invalid
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888

View File

@ -2,9 +2,9 @@
debug = False
verbose = False
[queues:drivers]
[drivers]
transport = invalid
storage = sqlite
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888

View File

@ -20,13 +20,13 @@ debug = True
;syslog_log_facility = LOG_LOCAL0
[queues:drivers]
[drivers]
# Transport driver module (e.g., wsgi, zmq)
transport = wsgi
# Storage driver module (e.g., mongodb, sqlite)
storage = sqlite
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
bind = 127.0.0.1
port = 8888
@ -35,10 +35,10 @@ port = 8888
;metadata_max_length = 65536
;content_max_length = 262144
;[queues:drivers:transport:zmq]
;[drivers:transport:zmq]
;port = 9999
[queues:limits:transport]
[limits:transport]
# The maximum number of queue records per page when listing queues
;queue_paging_uplimit = 20
# The maximum number of messages in a message posting, maximum

View File

@ -4,10 +4,10 @@ auth_strategy = keystone
debug = False
verbose = False
[queues:drivers]
[drivers]
transport = wsgi
storage = sqlite
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
bind = 0.0.0.0:8888
workers = 20

View File

@ -2,9 +2,9 @@
debug = False
verbose = False
[queues:drivers]
[drivers]
transport = wsgi
storage = faulty
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888

View File

@ -2,13 +2,13 @@
debug = False
verbose = False
[queues:drivers]
[drivers]
transport = wsgi
storage = mongodb
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888
[queues:drivers:storage:mongodb]
[drivers:storage:mongodb]
uri = mongodb://127.0.0.1:27017
database = marconi_test

View File

@ -1,10 +1,10 @@
[DEFAULT]
sharding = True
[queues:drivers]
[drivers]
transport = wsgi
storage = mongodb
[queues:drivers:storage:mongodb]
[drivers:storage:mongodb]
uri = mongodb://127.0.0.1:27017
database = marconi_test

View File

@ -2,9 +2,9 @@
debug = False
verbose = False
[proxy:drivers]
[drivers]
transport = wsgi
storage = memory
[proxy:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888

View File

@ -2,13 +2,13 @@
debug = False
verbose = False
[proxy:drivers]
[drivers]
transport = wsgi
storage = mongodb
[proxy:drivers:transport:wsgi]
[drivers:transport:wsgi]
port = 8888
[proxy:drivers:storage:mongodb]
[drivers:storage:mongodb]
uri = mongodb://127.0.0.1:27017
database = marconi_proxy_test

View File

@ -3,11 +3,11 @@ debug = False
verbose = False
admin_mode = False
[queues:drivers]
[drivers]
transport = wsgi
storage = sqlite
[queues:drivers:transport:wsgi]
[drivers:transport:wsgi]
bind = 0.0.0.0
port = 8888
workers = 20

View File

@ -1,7 +1,7 @@
[queues:drivers]
[drivers]
transport = wsgi
storage = sqlite
[queues:limits:storage]
[limits:storage]
default_queue_paging = 1
default_message_paging = 2

View File

@ -1,6 +1,6 @@
[DEFAULT]
sharding = True
[queues:drivers]
[drivers]
transport = wsgi
storage = sqlite

View File

@ -1,7 +1,7 @@
[queues:drivers]
[drivers]
transport = wsgi
storage = sqlite
[queues:limits:transport]
[limits:transport]
metadata_size_uplimit = 64
message_size_uplimit = 256

View File

@ -36,7 +36,7 @@ class TestShardCatalog(testing.TestBase):
super(TestShardCatalog, self).setUp()
self.conf.register_opts([cfg.StrOpt('storage')],
group='queues:drivers')
group='drivers')
control = utils.load_storage_driver(self.conf, control_mode=True)
self.catalogue_ctrl = control.catalogue_controller
self.shards_ctrl = control.shards_controller

View File

@ -35,7 +35,7 @@ class MessagesBaseTest(base.TestBase):
if self.conf.sharding:
for i in range(4):
uri = self.conf['queues:drivers:storage:mongodb'].uri
uri = self.conf['drivers:storage:mongodb'].uri
doc = {'weight': 100, 'uri': uri}
self.simulate_put('/v1/shards/' + str(i),
body=json.dumps(doc))