improve OptGroup consistency across configuration

This is a follow-up to: https://review.opendev.org/#/c/666897/
and makes sure titles and help information get rendered in
the configuration documentation and configuration samples.

The options for the placement_client group are already changed
and left untouched as a result. The changes to grafana_client
are already done in another patch and also untouched.

Change-Id: Ia33cd4576e4b55e651f3f3779a01f2867126138d
This commit is contained in:
Dantali0n
2019-06-26 06:44:56 +00:00
parent 4d35aabfdf
commit cebee2c4d7
20 changed files with 62 additions and 50 deletions

View File

@@ -22,6 +22,7 @@ from watcher.conf import api as conf_api
from watcher.conf import applier as conf_applier
from watcher.conf import ceilometer_client as conf_ceilometer_client
from watcher.conf import cinder_client as conf_cinder_client
from watcher.conf import clients_auth as conf_auth
from watcher.conf import db
from watcher.conf import decision_engine as conf_de
from watcher.conf import exception
@@ -39,19 +40,22 @@ def list_opts():
(conf_api.AUTH_OPTS +
exception.EXC_LOG_OPTS +
paths.PATH_OPTS)),
('api', conf_api.API_SERVICE_OPTS),
('database', db.SQL_OPTS),
('watcher_planner', conf_planner.WATCHER_PLANNER_OPTS),
('watcher_applier', conf_applier.APPLIER_MANAGER_OPTS),
('watcher_decision_engine',
(conf_de.WATCHER_DECISION_ENGINE_OPTS +
conf_de.WATCHER_CONTINUOUS_OPTS)),
('nova_client', conf_nova_client.NOVA_CLIENT_OPTS),
('glance_client', conf_glance_client.GLANCE_CLIENT_OPTS),
('cinder_client', conf_cinder_client.CINDER_CLIENT_OPTS),
('ceilometer_client', conf_ceilometer_client.CEILOMETER_CLIENT_OPTS),
('neutron_client', conf_neutron_client.NEUTRON_CLIENT_OPTS),
('watcher_clients_auth',
(conf_api.api, conf_api.API_SERVICE_OPTS),
(db.database, db.SQL_OPTS),
(conf_planner.watcher_planner, conf_planner.WATCHER_PLANNER_OPTS),
(conf_applier.watcher_applier, conf_applier.APPLIER_MANAGER_OPTS),
(conf_de.watcher_decision_engine,
(conf_de.WATCHER_DECISION_ENGINE_OPTS)),
(conf_nova_client.nova_client, conf_nova_client.NOVA_CLIENT_OPTS),
(conf_glance_client.glance_client,
conf_glance_client.GLANCE_CLIENT_OPTS),
(conf_cinder_client.cinder_client,
conf_cinder_client.CINDER_CLIENT_OPTS),
(conf_ceilometer_client.ceilometer_client,
conf_ceilometer_client.CEILOMETER_CLIENT_OPTS),
(conf_neutron_client.neutron_client,
conf_neutron_client.NEUTRON_CLIENT_OPTS),
(conf_auth.WATCHER_CLIENTS_AUTH,
(ka_loading.get_auth_common_conf_options() +
ka_loading.get_auth_plugin_conf_options('password') +
ka_loading.get_session_conf_options()))

View File

@@ -65,4 +65,4 @@ def register_opts(conf):
def list_opts():
return [('api', API_SERVICE_OPTS), ('DEFAULT', AUTH_OPTS)]
return [(api, API_SERVICE_OPTS), ('DEFAULT', AUTH_OPTS)]

View File

@@ -50,4 +50,4 @@ def register_opts(conf):
def list_opts():
return [('watcher_applier', APPLIER_MANAGER_OPTS)]
return [(watcher_applier, APPLIER_MANAGER_OPTS)]

View File

@@ -60,4 +60,4 @@ def register_opts(conf):
def list_opts():
return [('ceilometer_client', CEILOMETER_CLIENT_OPTS)]
return [(ceilometer_client, CEILOMETER_CLIENT_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('cinder_client', CINDER_CLIENT_OPTS)]
return [(cinder_client, CINDER_CLIENT_OPTS)]

View File

@@ -27,5 +27,5 @@ def register_opts(conf):
def list_opts():
return [('watcher_clients_auth', ka_loading.get_session_conf_options() +
return [(WATCHER_CLIENTS_AUTH, ka_loading.get_session_conf_options() +
ka_loading.get_auth_common_conf_options())]

View File

@@ -45,4 +45,4 @@ def register_opts(conf):
def list_opts():
return [('collector', COLLECTOR_OPTS)]
return [(collector, COLLECTOR_OPTS)]

View File

@@ -56,4 +56,4 @@ def register_opts(conf):
def list_opts():
return [('watcher_datasources', DATASOURCES_OPTS)]
return [(datasources, DATASOURCES_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('database', SQL_OPTS)]
return [(database, SQL_OPTS)]

View File

@@ -68,24 +68,19 @@ WATCHER_DECISION_ENGINE_OPTS = [
' instance_cpu_usage: VM_CPU\n'
' gnocchi:\n'
' instance_cpu_usage: cpu_vm_util\n\n'
'This file is optional.')]
WATCHER_CONTINUOUS_OPTS = [
'This file is optional.'),
cfg.IntOpt('continuous_audit_interval',
default=10,
mutable=True,
help='Interval (in seconds) for checking newly created '
'continuous audits.')
]
'continuous audits.')]
def register_opts(conf):
conf.register_group(watcher_decision_engine)
conf.register_opts(WATCHER_DECISION_ENGINE_OPTS,
group=watcher_decision_engine)
conf.register_opts(WATCHER_CONTINUOUS_OPTS, group=watcher_decision_engine)
def list_opts():
return [('watcher_decision_engine', WATCHER_DECISION_ENGINE_OPTS),
('watcher_decision_engine', WATCHER_CONTINUOUS_OPTS)]
return [(watcher_decision_engine, WATCHER_DECISION_ENGINE_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('glance_client', GLANCE_CLIENT_OPTS)]
return [(glance_client, GLANCE_CLIENT_OPTS)]

View File

@@ -42,4 +42,4 @@ def register_opts(conf):
def list_opts():
return [('gnocchi_client', GNOCCHI_CLIENT_OPTS)]
return [(gnocchi_client, GNOCCHI_CLIENT_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('grafana_translators', GRAFANA_TRANSLATOR_INFLUX_OPTS)]
return [(grafana_translators, GRAFANA_TRANSLATOR_INFLUX_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('ironic_client', IRONIC_CLIENT_OPTS)]
return [(ironic_client, IRONIC_CLIENT_OPTS)]

View File

@@ -35,4 +35,4 @@ def register_opts(conf):
def list_opts():
return [('keystone_client', KEYSTONE_CLIENT_OPTS)]
return [(keystone_client, KEYSTONE_CLIENT_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('monasca_client', MONASCA_CLIENT_OPTS)]
return [(monasca_client, MONASCA_CLIENT_OPTS)]

View File

@@ -41,4 +41,4 @@ def register_opts(conf):
def list_opts():
return [('neutron_client', NEUTRON_CLIENT_OPTS)]
return [(neutron_client, NEUTRON_CLIENT_OPTS)]

View File

@@ -52,4 +52,4 @@ def register_opts(conf):
def list_opts():
return [('nova_client', NOVA_CLIENT_OPTS)]
return [(nova_client, NOVA_CLIENT_OPTS)]

View File

@@ -38,4 +38,4 @@ def register_opts(conf):
def list_opts():
return [('watcher_planner', WATCHER_PLANNER_OPTS)]
return [(watcher_planner, WATCHER_PLANNER_OPTS)]