Add currently necessary oslo namespaces to oslo-config-generator conf file.
This commit adds the following namespaces to deckhand's config-generator.conf file used by oslo-config-generator to generate deckhand's conf file automatically: * oslo.db * oslo.db.concurrency * oslo.log This will automatically populate the generate conf file with needed oslo config options.
This commit is contained in:
parent
82e3177404
commit
2fd01fd9b4
@ -51,17 +51,6 @@ keystone_auth_opts = [
|
|||||||
default='http://127.0.0.1/identity/v3')
|
default='http://127.0.0.1/identity/v3')
|
||||||
]
|
]
|
||||||
|
|
||||||
logging_group = cfg.OptGroup(
|
|
||||||
name='logging',
|
|
||||||
title='Logging Options',
|
|
||||||
help='Logging options for Deckhand.')
|
|
||||||
|
|
||||||
logging_opts = [
|
|
||||||
cfg.StrOpt('global_logger_name',
|
|
||||||
default='deckhand',
|
|
||||||
help='Logger name for the top-level logger.')
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
conf.register_group(barbican_group)
|
conf.register_group(barbican_group)
|
||||||
@ -70,14 +59,10 @@ def register_opts(conf):
|
|||||||
conf.register_group(keystone_auth_group)
|
conf.register_group(keystone_auth_group)
|
||||||
conf.register_opts(keystone_auth_opts, group=keystone_auth_group)
|
conf.register_opts(keystone_auth_opts, group=keystone_auth_group)
|
||||||
|
|
||||||
conf.register_group(logging_group)
|
|
||||||
conf.register_opts(logging_opts, group=logging_group)
|
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return {barbican_group: barbican_opts,
|
return {barbican_group: barbican_opts,
|
||||||
keystone_auth_group: keystone_auth_opts,
|
keystone_auth_group: keystone_auth_opts}
|
||||||
logging_group: logging_opts}
|
|
||||||
|
|
||||||
|
|
||||||
def parse_args(args=None, usage=None, default_config_files=None):
|
def parse_args(args=None, usage=None, default_config_files=None):
|
||||||
|
@ -30,7 +30,7 @@ LOG = None
|
|||||||
|
|
||||||
def __setup_logging():
|
def __setup_logging():
|
||||||
global LOG
|
global LOG
|
||||||
LOGGER_NAME = CONF.logging.global_logger_name
|
LOGGER_NAME = 'deckhand'
|
||||||
LOG = logging.getLogger(__name__, LOGGER_NAME)
|
LOG = logging.getLogger(__name__, LOGGER_NAME)
|
||||||
|
|
||||||
logging.register_options(CONF)
|
logging.register_options(CONF)
|
||||||
@ -58,9 +58,6 @@ def start_api(state_manager=None):
|
|||||||
Create routes for the v1.0 API and sets up logging.
|
Create routes for the v1.0 API and sets up logging.
|
||||||
"""
|
"""
|
||||||
__setup_logging()
|
__setup_logging()
|
||||||
# FOR TESTING -- REMOVE
|
|
||||||
engine = db_api.get_engine()
|
|
||||||
assert engine.engine.name == 'sqlite'
|
|
||||||
|
|
||||||
control_api = falcon.API(request_type=api_base.DeckhandRequest)
|
control_api = falcon.API(request_type=api_base.DeckhandRequest)
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ from oslo_db import exception as db_exception
|
|||||||
from oslo_db.sqlalchemy import session
|
from oslo_db.sqlalchemy import session
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import excutils
|
from oslo_utils import excutils
|
||||||
import osprofiler.sqlalchemy
|
|
||||||
from retrying import retry
|
|
||||||
import six
|
import six
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_versionedobjects.fields as ovo_fields
|
from oslo_versionedobjects import fields as ovo_fields
|
||||||
|
|
||||||
from deckhand.db.sqlalchemy import api as db_api
|
from deckhand.db.sqlalchemy import api as db_api
|
||||||
from deckhand import objects
|
from deckhand import objects
|
||||||
|
@ -22,10 +22,12 @@ from deckhand.control import base as api_base
|
|||||||
|
|
||||||
class TestApi(testtools.TestCase):
|
class TestApi(testtools.TestCase):
|
||||||
|
|
||||||
|
@mock.patch.object(api, 'config', autospec=True)
|
||||||
@mock.patch.object(api, 'secrets', autospec=True)
|
@mock.patch.object(api, 'secrets', autospec=True)
|
||||||
@mock.patch.object(api, 'documents', autospec=True)
|
@mock.patch.object(api, 'documents', autospec=True)
|
||||||
@mock.patch.object(api, 'falcon', autospec=True)
|
@mock.patch.object(api, 'falcon', autospec=True)
|
||||||
def test_start_api(self, mock_falcon, mock_documents, mock_secrets):
|
def test_start_api(self, mock_falcon, mock_documents, mock_secrets,
|
||||||
|
mock_config):
|
||||||
mock_falcon_api = mock_falcon.API.return_value
|
mock_falcon_api = mock_falcon.API.return_value
|
||||||
|
|
||||||
result = api.start_api()
|
result = api.start_api()
|
||||||
@ -37,4 +39,5 @@ class TestApi(testtools.TestCase):
|
|||||||
mock.call(
|
mock.call(
|
||||||
'/api/v1.0/documents', mock_documents.DocumentsResource()),
|
'/api/v1.0/documents', mock_documents.DocumentsResource()),
|
||||||
mock.call('/api/v1.0/secrets', mock_secrets.SecretsResource())
|
mock.call('/api/v1.0/secrets', mock_secrets.SecretsResource())
|
||||||
])
|
])
|
||||||
|
mock_config.parse_args.assert_called_once_with()
|
||||||
|
@ -2,3 +2,6 @@
|
|||||||
output_file = etc/deckhand/deckhand.conf.sample
|
output_file = etc/deckhand/deckhand.conf.sample
|
||||||
wrap_width = 80
|
wrap_width = 80
|
||||||
namespace = deckhand.conf
|
namespace = deckhand.conf
|
||||||
|
namespace = oslo.db
|
||||||
|
namespace = oslo.db.concurrency
|
||||||
|
namespace = oslo.log
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
falcon==1.1.0
|
falcon==1.1.0
|
||||||
|
|
||||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
|
||||||
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
||||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||||
six>=1.9.0 # MIT
|
six>=1.9.0 # MIT
|
||||||
|
oslo.concurrency>=3.8.0 # Apache-2.0
|
||||||
stevedore>=1.20.0 # Apache-2.0
|
stevedore>=1.20.0 # Apache-2.0
|
||||||
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
||||||
keystoneauth1>=2.21.0 # Apache-2.0
|
keystoneauth1>=2.21.0 # Apache-2.0
|
||||||
@ -12,6 +12,7 @@ oslo.context>=2.14.0 # Apache-2.0
|
|||||||
oslo.utils>=3.20.0 # Apache-2.0
|
oslo.utils>=3.20.0 # Apache-2.0
|
||||||
oslo.db>=4.21.1 # Apache-2.0
|
oslo.db>=4.21.1 # Apache-2.0
|
||||||
oslo.log>=3.22.0 # Apache-2.0
|
oslo.log>=3.22.0 # Apache-2.0
|
||||||
|
oslo.messaging!=5.25.0,>=5.24.2 # Apache-2.0
|
||||||
oslo.serialization>=1.10.0 # Apache-2.0
|
oslo.serialization>=1.10.0 # Apache-2.0
|
||||||
oslo.utils>=3.20.0 # Apache-2.0
|
oslo.utils>=3.20.0 # Apache-2.0
|
||||||
oslo.versionedobjects>=1.23.0
|
oslo.versionedobjects>=1.23.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user