From a5f6a89a1816f605beb12265eaf1df4d915b76af Mon Sep 17 00:00:00 2001 From: Aimee Ukasick Date: Wed, 18 Jan 2017 20:22:55 -0600 Subject: [PATCH] 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 --- congress/common/config.py | 23 +++++++++++++++++++++-- congress/dse2/dse_node.py | 22 ---------------------- congress/opts.py | 2 +- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/congress/common/config.py b/congress/common/config.py index 11c629786..b08d7ea59 100644 --- a/congress/common/config.py +++ b/congress/common/config.py @@ -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) diff --git a/congress/dse2/dse_node.py b/congress/dse2/dse_node.py index 2a30058cf..9ffd3e111 100644 --- a/congress/dse2/dse_node.py +++ b/congress/dse2/dse_node.py @@ -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. diff --git a/congress/opts.py b/congress/opts.py index 10b30caa5..760ec4332 100644 --- a/congress/opts.py +++ b/congress/opts.py @@ -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) ]