Split config definitions to make CLI help cleaner

Change-Id: I2903a3e61597913c6ace84605879b06526ad07f7
This commit is contained in:
Ilya Shakhat
2015-06-22 15:54:18 +03:00
parent 13dc944373
commit 47a809bc11
8 changed files with 67 additions and 160 deletions

View File

@@ -18,19 +18,18 @@ import copy
from oslo_config import cfg
OPTS = [
CONNECTION_OPTS = [
cfg.StrOpt('runtime-storage-uri', default='memcached://127.0.0.1:11211',
help='Storage URI'),
]
PROCESSOR_OPTS = [
cfg.StrOpt('default-data-uri',
default='https://git.openstack.org/cgit/'
'stackforge/stackalytics/plain/etc/default_data.json',
help='URI for default data'),
cfg.StrOpt('sources-root', default='/var/local/stackalytics',
help='The folder that holds all project sources to analyze'),
cfg.StrOpt('runtime-storage-uri', default='memcached://127.0.0.1:11211',
help='Storage URI'),
cfg.StrOpt('listen-host', default='127.0.0.1',
help='The address dashboard listens on'),
cfg.IntOpt('listen-port', default=8080,
help='The port dashboard listens on'),
cfg.IntOpt('days_to_update_members', default=30,
help='Number of days to update members'),
cfg.StrOpt('corrections-uri',
@@ -45,8 +44,6 @@ OPTS = [
help='SSH key for gerrit review system access'),
cfg.StrOpt('ssh-username', default='user',
help='SSH username for gerrit review system access'),
cfg.BoolOpt('force-update', default=False,
help='Forcibly read default data and update records'),
cfg.StrOpt('project-list-uri',
default=('https://git.openstack.org/cgit/'
'openstack/governance/plain/reference/projects.yaml'),
@@ -55,6 +52,15 @@ OPTS = [
default='https://git.openstack.org/cgit/'
'stackforge/driverlog/plain/etc/default_data.json',
help='URI for default data'),
cfg.IntOpt('members-look-ahead', default=250,
help='How many member profiles to look ahead after the last'),
]
DASHBOARD_OPTS = [
cfg.StrOpt('listen-host', default='127.0.0.1',
help='The address dashboard listens on'),
cfg.IntOpt('listen-port', default=8080,
help='The port dashboard listens on'),
cfg.StrOpt('default-metric', default='marks',
help='Default metric'),
cfg.StrOpt('default-release',
@@ -65,14 +71,12 @@ OPTS = [
help='The interval specifies how frequently dashboard should '
'check for updates in seconds'),
cfg.StrOpt('collect-profiler-stats',
help='Name of file to store python profiler data. This option '
'works for dashboard only'),
cfg.IntOpt('members-look-ahead', default=250,
help='How many member profiles to look ahead after the last'),
help='Name of file to store python profiler data'),
cfg.IntOpt('age-warn', default=2 * 24 * 60 * 60,
help='Warn if the age of data is more than this value, sec'),
]
def list_opts():
yield (None, copy.deepcopy(OPTS))
yield (None, copy.deepcopy(CONNECTION_OPTS + PROCESSOR_OPTS +
DASHBOARD_OPTS))