Support to generate config sample file

Change-Id: Ic9dc4630dd96227eb8a655c3aac223316d5a060e
This commit is contained in:
Lingxian Kong 2020-05-29 23:00:27 +12:00
parent 5011892b37
commit 87b65e3c05
3 changed files with 34 additions and 3 deletions

View File

@ -150,8 +150,16 @@ guest instance doesn't affect other instances nor other cloud users.
Configuring Trove
~~~~~~~~~~~~~~~~~
The default Trove configuration file location is ``/etc/trove/trove.conf``. The
typical config options (not a full list) are:
The default Trove configuration file location is ``/etc/trove/trove.conf``. You
can generate a sample config file by running:
.. code-block:: console
cd <trove dir>
pip install -e .
oslo-config-generator --namespace trove.config --namespace oslo.messaging --namespace oslo.log --namespace oslo.log oslo.policy --output-file /etc/trove/trove.conf.sample
The typical config options (not a full list) are:
DEFAULT group
enable_secure_rpc_messaging

View File

@ -58,3 +58,6 @@ oslo.policy.policies =
# list_rules method into a separate entry point rather than using the
# aggregate method.
trove = trove.common.policies:list_rules
oslo.config.opts =
trove.config = trove.common.cfg:list_opts

View File

@ -17,9 +17,11 @@
import os.path
from keystoneauth1 import loading
from keystonemiddleware import auth_token
from oslo_config import cfg
from oslo_config.cfg import NoSuchOptError
from oslo_config import types
from oslo_config.cfg import NoSuchOptError
from oslo_log import log as logging
from oslo_middleware import cors
from osprofiler import opts as profiler
@ -1470,6 +1472,24 @@ profiler.set_defaults(CONF)
logging.register_options(CONF)
def list_opts():
keystone_middleware_opts = auth_token.list_opts()
keystone_loading_opts = [(
'keystone_authtoken', loading.get_auth_plugin_conf_options('password')
)]
trove_opts = [
(None, path_opts + versions_opts + common_opts),
('database', database_opts),
(mysql_group, mysql_opts),
(mariadb_group, mariadb_opts),
(network_group, network_opts),
(service_credentials_group, service_credentials_opts),
]
return keystone_middleware_opts + keystone_loading_opts + trove_opts
def custom_parser(parsername, parser):
CONF.register_cli_opt(cfg.SubCommandOpt(parsername, handler=parser))