Fixes congress.conf.sample file generation

Fixes array name and CONF registering issue that prevented
tox -egenconfig from correctly generating the
congress.conf.sample file.
Refactored to move dse_opts into config.py.

Closes-Bug: 1657620
Partial-Bug: 1651928

Change-Id: I4057de278323373ea45653276fb5b243eb673e2f
This commit is contained in:
Aimee Ukasick 2017-01-18 20:22:55 -06:00
parent 507b81f15e
commit a5f6a89a18
3 changed files with 22 additions and 25 deletions

View File

@ -25,7 +25,6 @@ from oslo_log import log as logging
from oslo_middleware import cors
from oslo_policy import opts as policy_opts
from congress.dse2 import dse_node
from congress import version
LOG = logging.getLogger(__name__)
@ -83,8 +82,28 @@ core_opts = [
# Register the configuration options
cfg.CONF.register_opts(core_opts)
dse_opts = [
cfg.StrOpt('bus_id', default='bus',
help='Unique ID of this DSE bus'),
cfg.IntOpt('ping_timeout', default=5,
help='RPC short timeout in seconds; used to ping destination'),
cfg.IntOpt('long_timeout', default=120,
help='RPC long timeout in seconds; used on potentially long '
'running requests such as datasource action and PE row '
'query'),
cfg.IntOpt('time_to_resub', default=10,
help='Time in seconds which a subscriber will wait for missing '
'update before attempting to resubscribe from publisher'),
cfg.BoolOpt('execute_action_retry', default=False,
help='Set the flag to True to make Congress retry execute '
'actions; may cause duplicate executions.'),
cfg.IntOpt('execute_action_retry_timeout', default=600,
help='The number of seconds to retry execute action before '
'giving up. Zero or negative value means never give up.'),
]
# Register dse opts
cfg.CONF.register_opts(dse_node.dse_opts, group='dse')
cfg.CONF.register_opts(dse_opts, group='dse')
policy_opts.set_defaults(cfg.CONF, 'policy.json')
logging.register_options(cfg.CONF)

View File

@ -39,28 +39,6 @@ from congress import exception
LOG = logging.getLogger(__name__)
dse_opts = [
cfg.StrOpt('bus_id', default='bus',
help='Unique ID of this DSE bus'),
cfg.IntOpt('ping_timeout', default=5,
help='RPC short timeout in seconds; used to ping destination'),
cfg.IntOpt('long_timeout', default=120,
help='RPC long timeout in seconds; used on potentially long '
'running requests such as datasource action and PE row '
'query'),
cfg.IntOpt('time_to_resub', default=10,
help='Time in seconds which a subscriber will wait for missing '
'update before attempting to resubscribe from publisher'),
cfg.BoolOpt('execute_action_retry', default=False,
help='Set the flag to True to make Congress retry execute '
'actions; may cause duplicate executions.'),
cfg.IntOpt('execute_action_retry_timeout', default=600,
help='The number of seconds to retry execute action before '
'giving up. Zero or negative value means never give up.'),
]
# cfg.CONF.register_opts(_dse_opts, group='dse')
class DseNode(object):
"""Addressable entity participating on the DSE message bus.

View File

@ -33,5 +33,5 @@ def list_opts():
congress.utils.utils_opts,
congress.exception.exc_log_opts,
)),
('dse', congress.dse2.dse_node._dse_opts)
('dse', congress.common.config.dse_opts)
]