Cue genconfig
This updates tox -egenconfig to correctly generate configuration files for the various components of cue. Included are list_opts invocations for all places where configuration is found, appropriate setup.cfg hooks for generic oslo-config-generator invocations, and explicit genconfig configuration files for the monitor, worker, and api. Sample configurations have been regenerated from source. Change-Id: Ib838269b3ba1e81587cd984933edb41d6d6a555a
This commit is contained in:
parent
9a72d4f63a
commit
28519ccefe
|
@ -20,7 +20,7 @@ from oslo_log import log
|
|||
|
||||
log.register_options(cfg.CONF)
|
||||
|
||||
cfg.CONF.register_opts([
|
||||
DEFAULT_OPTS = [
|
||||
cfg.StrOpt('pybasedir',
|
||||
default=os.path.abspath(os.path.join(os.path.dirname(__file__),
|
||||
'../')),
|
||||
|
@ -41,4 +41,10 @@ cfg.CONF.register_opts([
|
|||
cfg.StrOpt('default_broker_name',
|
||||
default='rabbitmq',
|
||||
help='The name of the default broker image')
|
||||
])
|
||||
]
|
||||
|
||||
cfg.CONF.register_opts(DEFAULT_OPTS)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('DEFAULT', DEFAULT_OPTS)]
|
|
@ -42,3 +42,7 @@ opt_group = cfg.OptGroup(name='api',
|
|||
title='Options for the cue-api service')
|
||||
CONF.register_group(opt_group)
|
||||
CONF.register_opts(API_SERVICE_OPTS, opt_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('api', API_SERVICE_OPTS)]
|
|
@ -30,13 +30,18 @@ auth_opts = [
|
|||
help='Method to use for authentication: noauth or keystone.'),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(auth_opts)
|
||||
|
||||
cfg.CONF.register_opts([
|
||||
API_OPTS = [
|
||||
cfg.BoolOpt('pecan_debug', default=False,
|
||||
help='Pecan HTML Debug Interface'),
|
||||
], group='api')
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(auth_opts)
|
||||
CONF.register_opts(API_OPTS, group='api')
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('DEFAULT', auth_opts), ('api', API_OPTS)]
|
||||
|
||||
|
||||
def get_pecan_config():
|
||||
|
|
|
@ -49,6 +49,10 @@ cfg.CONF.register_group(opt_group)
|
|||
cfg.CONF.register_opts(WORKER_OPTS, group=opt_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('worker', WORKER_OPTS)]
|
||||
|
||||
|
||||
def main():
|
||||
# Initialize environment
|
||||
CONF = cfg.CONF
|
||||
|
|
|
@ -42,6 +42,7 @@ CONF = cfg.CONF
|
|||
|
||||
CONF.register_opts(service_opts)
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -54,3 +55,7 @@ def prepare_service(argv=None):
|
|||
argv = sys.argv
|
||||
CONF(argv[1:], project='cue')
|
||||
log.setup(CONF, 'cue')
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('DEFAULT', service_opts)]
|
||||
|
|
|
@ -19,7 +19,7 @@ CONF = cfg.CONF
|
|||
|
||||
|
||||
MONITOR_OPTS = [
|
||||
cfg.StrOpt('loop_interval_seconds',
|
||||
cfg.IntOpt('loop_interval_seconds',
|
||||
help='How often Cluster Status is checked.',
|
||||
default=60)
|
||||
]
|
||||
|
@ -31,3 +31,7 @@ opt_group = cfg.OptGroup(
|
|||
|
||||
CONF.register_group(opt_group)
|
||||
CONF.register_opts(MONITOR_OPTS, group='cue_monitor')
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('cue_monitor', MONITOR_OPTS)]
|
|
@ -68,3 +68,7 @@ opt_group = cfg.OptGroup(
|
|||
|
||||
CONF.register_group(opt_group)
|
||||
CONF.register_opts(TF_OPTS, group='taskflow')
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [('taskflow', TF_OPTS)]
|
|
@ -0,0 +1,68 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
import cue as cue
|
||||
import cue.api as cue_api
|
||||
import cue.api.app as cue_api_app
|
||||
import cue.cmd.worker as cue_cmd_worker
|
||||
import cue.common.service as cue_common_service
|
||||
import cue.monitor as cue_monitor
|
||||
import cue.taskflow as cue_taskflow
|
||||
from cue.tests.unit import base
|
||||
|
||||
|
||||
class OsloConfigGenTestCase(base.UnitTestCase):
|
||||
def setUp(self):
|
||||
super(OsloConfigGenTestCase, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
super(OsloConfigGenTestCase, self).tearDown()
|
||||
|
||||
def test_global_opts(self):
|
||||
opts = cue.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('DEFAULT', opts[0][0])
|
||||
|
||||
def test_api_opts(self):
|
||||
opts = cue_api.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('api', opts[0][0])
|
||||
|
||||
def test_api_app_opts(self):
|
||||
opts = cue_api_app.list_opts()
|
||||
self.assertEqual(2, len(opts))
|
||||
self.assertEqual('DEFAULT', opts[0][0])
|
||||
self.assertEqual('api', opts[1][0])
|
||||
|
||||
def test_cmd_worker_opts(self):
|
||||
opts = cue_cmd_worker.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('worker', opts[0][0])
|
||||
|
||||
def test_common_service_opts(self):
|
||||
opts = cue_common_service.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('DEFAULT', opts[0][0])
|
||||
|
||||
def test_monitor_opts(self):
|
||||
opts = cue_monitor.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('cue_monitor', opts[0][0])
|
||||
|
||||
def test_taskflow_opts(self):
|
||||
opts = cue_taskflow.list_opts()
|
||||
self.assertEqual(1, len(opts))
|
||||
self.assertEqual('taskflow', opts[0][0])
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,260 @@
|
|||
[DEFAULT]
|
||||
|
||||
#
|
||||
# From cue
|
||||
#
|
||||
|
||||
# Directory where the cue python module is installed (string value)
|
||||
#pybasedir = /Users/krotscheck/Desktop/openstack/cue
|
||||
|
||||
# Top-level directory for maintaining cue's state (string value)
|
||||
#state_path = /var/lib/cue
|
||||
|
||||
# The port to access RabbitMQ AMQP interface on a clusteredvm (string value)
|
||||
#rabbit_port = 5672
|
||||
|
||||
# The default Security Group to use for VMs created as part of a cluster
|
||||
# (string value)
|
||||
#os_security_group = <None>
|
||||
|
||||
# The id representing the management network (string value)
|
||||
#management_network_id = <None>
|
||||
|
||||
# The name of the default broker image (string value)
|
||||
#default_broker_name = rabbitmq
|
||||
|
||||
#
|
||||
# From oslo.log
|
||||
#
|
||||
|
||||
# Print debugging output (set logging level to DEBUG instead of default INFO
|
||||
# level). (boolean value)
|
||||
#debug = false
|
||||
|
||||
# If set to false, will disable INFO logging level, making WARNING the default.
|
||||
# (boolean value)
|
||||
# This option is deprecated for removal.
|
||||
# Its value may be silently ignored in the future.
|
||||
#verbose = true
|
||||
|
||||
# The name of a logging configuration file. This file is appended to any
|
||||
# existing logging configuration files. For details about logging configuration
|
||||
# files, see the Python logging module documentation. Note that when logging
|
||||
# configuration files are used then all logging configuration is set in the
|
||||
# configuration file and other logging configuration options are ignored (for
|
||||
# example, log_format). (string value)
|
||||
# Deprecated group/name - [DEFAULT]/log_config
|
||||
#log_config_append = <None>
|
||||
|
||||
# DEPRECATED. A logging.Formatter log message format string which may use any
|
||||
# of the available logging.LogRecord attributes. This option is deprecated.
|
||||
# Please use logging_context_format_string and logging_default_format_string
|
||||
# instead. This option is ignored if log_config_append is set. (string value)
|
||||
#log_format = <None>
|
||||
|
||||
# Format string for %%(asctime)s in log records. Default: %(default)s . This
|
||||
# option is ignored if log_config_append is set. (string value)
|
||||
#log_date_format = %Y-%m-%d %H:%M:%S
|
||||
|
||||
# (Optional) Name of log file to output to. If no default is set, logging will
|
||||
# go to stdout. This option is ignored if log_config_append is set. (string
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/logfile
|
||||
#log_file = <None>
|
||||
|
||||
# (Optional) The base directory used for relative --log-file paths. This option
|
||||
# is ignored if log_config_append is set. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/logdir
|
||||
#log_dir = <None>
|
||||
|
||||
# (Optional) Uses logging handler designed to watch file system. When log file
|
||||
# is moved or removed this handler will open a new log file with specified path
|
||||
# instantaneously. It makes sense only if log-file option is specified and
|
||||
# Linux platform is used. This option is ignored if log_config_append is set.
|
||||
# (boolean value)
|
||||
#watch_log_file = false
|
||||
|
||||
# Use syslog for logging. Existing syslog format is DEPRECATED and will be
|
||||
# changed later to honor RFC5424. This option is ignored if log_config_append
|
||||
# is set. (boolean value)
|
||||
#use_syslog = false
|
||||
|
||||
# (Optional) Enables or disables syslog rfc5424 format for logging. If enabled,
|
||||
# prefixes the MSG part of the syslog message with APP-NAME (RFC5424). The
|
||||
# format without the APP-NAME is deprecated in Kilo, and will be removed in
|
||||
# Mitaka, along with this option. This option is ignored if log_config_append
|
||||
# is set. (boolean value)
|
||||
# This option is deprecated for removal.
|
||||
# Its value may be silently ignored in the future.
|
||||
#use_syslog_rfc_format = true
|
||||
|
||||
# Syslog facility to receive log lines. This option is ignored if
|
||||
# log_config_append is set. (string value)
|
||||
#syslog_log_facility = LOG_USER
|
||||
|
||||
# Log output to standard error. This option is ignored if log_config_append is
|
||||
# set. (boolean value)
|
||||
#use_stderr = true
|
||||
|
||||
# Format string to use for log messages with context. (string value)
|
||||
#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
|
||||
|
||||
# Format string to use for log messages without context. (string value)
|
||||
#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
|
||||
|
||||
# Data to append to log format when level is DEBUG. (string value)
|
||||
#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
|
||||
|
||||
# Prefix each line of exception output with this format. (string value)
|
||||
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s
|
||||
|
||||
# List of logger=LEVEL pairs. This option is ignored if log_config_append is
|
||||
# set. (list value)
|
||||
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN
|
||||
|
||||
# Enables or disables publication of error events. (boolean value)
|
||||
#publish_errors = false
|
||||
|
||||
# The format for an instance that is passed with the log message. (string
|
||||
# value)
|
||||
#instance_format = "[instance: %(uuid)s] "
|
||||
|
||||
# The format for an instance UUID that is passed with the log message. (string
|
||||
# value)
|
||||
#instance_uuid_format = "[instance: %(uuid)s] "
|
||||
|
||||
# Enables or disables fatal status of deprecations. (boolean value)
|
||||
#fatal_deprecations = false
|
||||
|
||||
|
||||
[cue_monitor]
|
||||
|
||||
#
|
||||
# From cue.monitor
|
||||
#
|
||||
|
||||
# How often Cluster Status is checked. (integer value)
|
||||
#loop_interval_seconds = 60
|
||||
|
||||
|
||||
[database]
|
||||
|
||||
#
|
||||
# From oslo.db
|
||||
#
|
||||
|
||||
# The file name to use with SQLite. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/sqlite_db
|
||||
#sqlite_db = oslo.sqlite
|
||||
|
||||
# If True, SQLite uses synchronous mode. (boolean value)
|
||||
# Deprecated group/name - [DEFAULT]/sqlite_synchronous
|
||||
#sqlite_synchronous = true
|
||||
|
||||
# The back end to use for the database. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/db_backend
|
||||
#backend = sqlalchemy
|
||||
|
||||
# The SQLAlchemy connection string to use to connect to the database. (string
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection
|
||||
# Deprecated group/name - [DATABASE]/sql_connection
|
||||
# Deprecated group/name - [sql]/connection
|
||||
#connection = <None>
|
||||
|
||||
# The SQLAlchemy connection string to use to connect to the slave database.
|
||||
# (string value)
|
||||
#slave_connection = <None>
|
||||
|
||||
# The SQL mode to be used for MySQL sessions. This option, including the
|
||||
# default, overrides any server-set SQL mode. To use whatever SQL mode is set
|
||||
# by the server configuration, set this to no value. Example: mysql_sql_mode=
|
||||
# (string value)
|
||||
#mysql_sql_mode = TRADITIONAL
|
||||
|
||||
# Timeout before idle SQL connections are reaped. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_idle_timeout
|
||||
# Deprecated group/name - [DATABASE]/sql_idle_timeout
|
||||
# Deprecated group/name - [sql]/idle_timeout
|
||||
#idle_timeout = 3600
|
||||
|
||||
# Minimum number of SQL connections to keep open in a pool. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_min_pool_size
|
||||
# Deprecated group/name - [DATABASE]/sql_min_pool_size
|
||||
#min_pool_size = 1
|
||||
|
||||
# Maximum number of SQL connections to keep open in a pool. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_pool_size
|
||||
# Deprecated group/name - [DATABASE]/sql_max_pool_size
|
||||
#max_pool_size = <None>
|
||||
|
||||
# Maximum number of database connection retries during startup. Set to -1 to
|
||||
# specify an infinite retry count. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_retries
|
||||
# Deprecated group/name - [DATABASE]/sql_max_retries
|
||||
#max_retries = 10
|
||||
|
||||
# Interval between retries of opening a SQL connection. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_retry_interval
|
||||
# Deprecated group/name - [DATABASE]/reconnect_interval
|
||||
#retry_interval = 10
|
||||
|
||||
# If set, use this value for max_overflow with SQLAlchemy. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_overflow
|
||||
# Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
|
||||
#max_overflow = <None>
|
||||
|
||||
# Verbosity of SQL debugging information: 0=None, 100=Everything. (integer
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection_debug
|
||||
#connection_debug = 0
|
||||
|
||||
# Add Python stack traces to SQL as comment strings. (boolean value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection_trace
|
||||
#connection_trace = false
|
||||
|
||||
# If set, use this value for pool_timeout with SQLAlchemy. (integer value)
|
||||
# Deprecated group/name - [DATABASE]/sqlalchemy_pool_timeout
|
||||
#pool_timeout = <None>
|
||||
|
||||
# Enable the experimental use of database reconnect on connection lost.
|
||||
# (boolean value)
|
||||
#use_db_reconnect = false
|
||||
|
||||
# Seconds between retries of a database transaction. (integer value)
|
||||
#db_retry_interval = 1
|
||||
|
||||
# If True, increases the interval between retries of a database operation up to
|
||||
# db_max_retry_interval. (boolean value)
|
||||
#db_inc_retry_interval = true
|
||||
|
||||
# If db_inc_retry_interval is set, the maximum seconds between retries of a
|
||||
# database operation. (integer value)
|
||||
#db_max_retry_interval = 10
|
||||
|
||||
# Maximum retries in case of connection error or deadlock error before error is
|
||||
# raised. Set to -1 to specify an infinite retry count. (integer value)
|
||||
#db_max_retries = 20
|
||||
|
||||
|
||||
[oslo_policy]
|
||||
|
||||
#
|
||||
# From oslo.policy
|
||||
#
|
||||
|
||||
# The JSON file that defines policies. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/policy_file
|
||||
#policy_file = policy.json
|
||||
|
||||
# Default rule. Enforced when a requested rule is not found. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/policy_default_rule
|
||||
#policy_default_rule = default
|
||||
|
||||
# Directories where policy configuration files are stored. They can be relative
|
||||
# to any directory in the search path defined by the config_dir option, or
|
||||
# absolute paths. The file defined by policy_file must exist for these
|
||||
# directories to be searched. Missing or empty directories are ignored. (multi
|
||||
# valued)
|
||||
# Deprecated group/name - [DEFAULT]/policy_dirs
|
||||
#policy_dirs = policy.d
|
|
@ -1,69 +1,298 @@
|
|||
[DEFAULT]
|
||||
|
||||
#
|
||||
# From cue
|
||||
#
|
||||
|
||||
# Directory where the cue python module is installed (string value)
|
||||
#pybasedir = /Users/krotscheck/Desktop/openstack/cue
|
||||
|
||||
# Top-level directory for maintaining cue's state (string value)
|
||||
#state_path = /var/lib/cue
|
||||
|
||||
# The port to access RabbitMQ AMQP interface on a clusteredvm (string value)
|
||||
#rabbit_port = 5672
|
||||
|
||||
# The default Security Group to use for VMs created as part of a cluster
|
||||
# (string value)
|
||||
#os_security_group = <None>
|
||||
|
||||
# The id representing the management network (string value)
|
||||
#management_network_id = <None>
|
||||
|
||||
# The name of the default broker image (string value)
|
||||
#default_broker_name = rabbitmq
|
||||
|
||||
#
|
||||
# From oslo.log
|
||||
#
|
||||
|
||||
# Print debugging output (set logging level to DEBUG instead of default INFO
|
||||
# level). (boolean value)
|
||||
#debug = false
|
||||
|
||||
# If set to false, will disable INFO logging level, making WARNING the default.
|
||||
# (boolean value)
|
||||
# This option is deprecated for removal.
|
||||
# Its value may be silently ignored in the future.
|
||||
#verbose = true
|
||||
|
||||
# The name of a logging configuration file. This file is appended to any
|
||||
# existing logging configuration files. For details about logging configuration
|
||||
# files, see the Python logging module documentation. Note that when logging
|
||||
# configuration files are used then all logging configuration is set in the
|
||||
# configuration file and other logging configuration options are ignored (for
|
||||
# example, log_format). (string value)
|
||||
# Deprecated group/name - [DEFAULT]/log_config
|
||||
#log_config_append = <None>
|
||||
|
||||
# DEPRECATED. A logging.Formatter log message format string which may use any
|
||||
# of the available logging.LogRecord attributes. This option is deprecated.
|
||||
# Please use logging_context_format_string and logging_default_format_string
|
||||
# instead. This option is ignored if log_config_append is set. (string value)
|
||||
#log_format = <None>
|
||||
|
||||
# Format string for %%(asctime)s in log records. Default: %(default)s . This
|
||||
# option is ignored if log_config_append is set. (string value)
|
||||
#log_date_format = %Y-%m-%d %H:%M:%S
|
||||
|
||||
# (Optional) Name of log file to output to. If no default is set, logging will
|
||||
# go to stdout. This option is ignored if log_config_append is set. (string
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/logfile
|
||||
#log_file = <None>
|
||||
|
||||
# (Optional) The base directory used for relative --log-file paths. This option
|
||||
# is ignored if log_config_append is set. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/logdir
|
||||
#log_dir = <None>
|
||||
|
||||
# (Optional) Uses logging handler designed to watch file system. When log file
|
||||
# is moved or removed this handler will open a new log file with specified path
|
||||
# instantaneously. It makes sense only if log-file option is specified and
|
||||
# Linux platform is used. This option is ignored if log_config_append is set.
|
||||
# (boolean value)
|
||||
#watch_log_file = false
|
||||
|
||||
# Use syslog for logging. Existing syslog format is DEPRECATED and will be
|
||||
# changed later to honor RFC5424. This option is ignored if log_config_append
|
||||
# is set. (boolean value)
|
||||
#use_syslog = false
|
||||
|
||||
# (Optional) Enables or disables syslog rfc5424 format for logging. If enabled,
|
||||
# prefixes the MSG part of the syslog message with APP-NAME (RFC5424). The
|
||||
# format without the APP-NAME is deprecated in Kilo, and will be removed in
|
||||
# Mitaka, along with this option. This option is ignored if log_config_append
|
||||
# is set. (boolean value)
|
||||
# This option is deprecated for removal.
|
||||
# Its value may be silently ignored in the future.
|
||||
#use_syslog_rfc_format = true
|
||||
|
||||
# Syslog facility to receive log lines. This option is ignored if
|
||||
# log_config_append is set. (string value)
|
||||
#syslog_log_facility = LOG_USER
|
||||
|
||||
# Log output to standard error. This option is ignored if log_config_append is
|
||||
# set. (boolean value)
|
||||
#use_stderr = true
|
||||
|
||||
# Format string to use for log messages with context. (string value)
|
||||
#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
|
||||
|
||||
# Format string to use for log messages without context. (string value)
|
||||
#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
|
||||
|
||||
# Data to append to log format when level is DEBUG. (string value)
|
||||
#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
|
||||
|
||||
# Prefix each line of exception output with this format. (string value)
|
||||
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s
|
||||
|
||||
# List of logger=LEVEL pairs. This option is ignored if log_config_append is
|
||||
# set. (list value)
|
||||
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN
|
||||
|
||||
# Enables or disables publication of error events. (boolean value)
|
||||
#publish_errors = false
|
||||
|
||||
# The format for an instance that is passed with the log message. (string
|
||||
# value)
|
||||
#instance_format = "[instance: %(uuid)s] "
|
||||
|
||||
# The format for an instance UUID that is passed with the log message. (string
|
||||
# value)
|
||||
#instance_uuid_format = "[instance: %(uuid)s] "
|
||||
|
||||
# Enables or disables fatal status of deprecations. (boolean value)
|
||||
#fatal_deprecations = false
|
||||
|
||||
|
||||
[database]
|
||||
|
||||
#
|
||||
# From oslo.db
|
||||
#
|
||||
|
||||
# The file name to use with SQLite. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/sqlite_db
|
||||
#sqlite_db = oslo.sqlite
|
||||
|
||||
# If True, SQLite uses synchronous mode. (boolean value)
|
||||
# Deprecated group/name - [DEFAULT]/sqlite_synchronous
|
||||
#sqlite_synchronous = true
|
||||
|
||||
# The back end to use for the database. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/db_backend
|
||||
#backend = sqlalchemy
|
||||
|
||||
# The SQLAlchemy connection string to use to connect to the database. (string
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection
|
||||
# Deprecated group/name - [DATABASE]/sql_connection
|
||||
# Deprecated group/name - [sql]/connection
|
||||
#connection = <None>
|
||||
|
||||
# The SQLAlchemy connection string to use to connect to the slave database.
|
||||
# (string value)
|
||||
#slave_connection = <None>
|
||||
|
||||
# The SQL mode to be used for MySQL sessions. This option, including the
|
||||
# default, overrides any server-set SQL mode. To use whatever SQL mode is set
|
||||
# by the server configuration, set this to no value. Example: mysql_sql_mode=
|
||||
# (string value)
|
||||
#mysql_sql_mode = TRADITIONAL
|
||||
|
||||
# Timeout before idle SQL connections are reaped. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_idle_timeout
|
||||
# Deprecated group/name - [DATABASE]/sql_idle_timeout
|
||||
# Deprecated group/name - [sql]/idle_timeout
|
||||
#idle_timeout = 3600
|
||||
|
||||
# Minimum number of SQL connections to keep open in a pool. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_min_pool_size
|
||||
# Deprecated group/name - [DATABASE]/sql_min_pool_size
|
||||
#min_pool_size = 1
|
||||
|
||||
# Maximum number of SQL connections to keep open in a pool. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_pool_size
|
||||
# Deprecated group/name - [DATABASE]/sql_max_pool_size
|
||||
#max_pool_size = <None>
|
||||
|
||||
# Maximum number of database connection retries during startup. Set to -1 to
|
||||
# specify an infinite retry count. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_retries
|
||||
# Deprecated group/name - [DATABASE]/sql_max_retries
|
||||
#max_retries = 10
|
||||
|
||||
# Interval between retries of opening a SQL connection. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_retry_interval
|
||||
# Deprecated group/name - [DATABASE]/reconnect_interval
|
||||
#retry_interval = 10
|
||||
|
||||
# If set, use this value for max_overflow with SQLAlchemy. (integer value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_max_overflow
|
||||
# Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
|
||||
#max_overflow = <None>
|
||||
|
||||
# Verbosity of SQL debugging information: 0=None, 100=Everything. (integer
|
||||
# value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection_debug
|
||||
#connection_debug = 0
|
||||
|
||||
# Add Python stack traces to SQL as comment strings. (boolean value)
|
||||
# Deprecated group/name - [DEFAULT]/sql_connection_trace
|
||||
#connection_trace = false
|
||||
|
||||
# If set, use this value for pool_timeout with SQLAlchemy. (integer value)
|
||||
# Deprecated group/name - [DATABASE]/sqlalchemy_pool_timeout
|
||||
#pool_timeout = <None>
|
||||
|
||||
# Enable the experimental use of database reconnect on connection lost.
|
||||
# (boolean value)
|
||||
#use_db_reconnect = false
|
||||
|
||||
# Seconds between retries of a database transaction. (integer value)
|
||||
#db_retry_interval = 1
|
||||
|
||||
# If True, increases the interval between retries of a database operation up to
|
||||
# db_max_retry_interval. (boolean value)
|
||||
#db_inc_retry_interval = true
|
||||
|
||||
# If db_inc_retry_interval is set, the maximum seconds between retries of a
|
||||
# database operation. (integer value)
|
||||
#db_max_retry_interval = 10
|
||||
|
||||
# Maximum retries in case of connection error or deadlock error before error is
|
||||
# raised. Set to -1 to specify an infinite retry count. (integer value)
|
||||
#db_max_retries = 20
|
||||
|
||||
|
||||
[oslo_policy]
|
||||
|
||||
#
|
||||
# From oslo.policy
|
||||
#
|
||||
|
||||
# The JSON file that defines policies. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/policy_file
|
||||
#policy_file = policy.json
|
||||
|
||||
# Default rule. Enforced when a requested rule is not found. (string value)
|
||||
# Deprecated group/name - [DEFAULT]/policy_default_rule
|
||||
#policy_default_rule = default
|
||||
|
||||
# Directories where policy configuration files are stored. They can be relative
|
||||
# to any directory in the search path defined by the config_dir option, or
|
||||
# absolute paths. The file defined by policy_file must exist for these
|
||||
# directories to be searched. Missing or empty directories are ignored. (multi
|
||||
# valued)
|
||||
# Deprecated group/name - [DEFAULT]/policy_dirs
|
||||
#policy_dirs = policy.d
|
||||
|
||||
|
||||
[taskflow]
|
||||
|
||||
#
|
||||
# Options for taskflow based workflow engine
|
||||
# From cue.taskflow
|
||||
#
|
||||
|
||||
#
|
||||
# Persistence connection, used to persist workflow state information.
|
||||
# If no connection string is supplied, zookeeper will be used by default
|
||||
# with the zookeeper configuration provided in the zk_* configurations.
|
||||
# Default:
|
||||
#
|
||||
#persistence_connection=zookeeper://127.0.0.1/cue/taskflow
|
||||
# Persistence connection. (string value)
|
||||
#persistence_connection = <None>
|
||||
|
||||
#
|
||||
# Zookeeper host list. A single address can be provided for a standalone
|
||||
# Zookeeper instance, or a comma separated list may be provided to
|
||||
# connect to an ensemble of Zookeeper hosts.
|
||||
# Default: localhost
|
||||
#
|
||||
#zk_hosts=127.0.0.1
|
||||
# Coordinator connection string prefix. (string value)
|
||||
#coord_url = zookeeper
|
||||
|
||||
#
|
||||
# Zookeeper znode path that will be used as the root for all taskflow related
|
||||
# information being persisted in Zookeeper.
|
||||
# Default: /cue/taskflow
|
||||
#
|
||||
#zk_path=/cue/taskflow
|
||||
# Zookeeper jobboard hosts. (string value)
|
||||
#zk_hosts = localhost
|
||||
|
||||
#
|
||||
# Timeout (in seconds) for zookeeper operations
|
||||
# Default: 10
|
||||
#
|
||||
#zk_timeout=10
|
||||
# Zookeeper jobboard port. (string value)
|
||||
#zk_port = 2181
|
||||
|
||||
#
|
||||
# Jobboard name
|
||||
# Default: cue
|
||||
#
|
||||
#jobboard_name=cue
|
||||
# Zookeeper path for jobs. (string value)
|
||||
#zk_path = /cue/taskflow
|
||||
|
||||
#
|
||||
# Taskflow Engine type used by the worker to run jobs. Only serial and parallel
|
||||
# are supported
|
||||
# Default: serial
|
||||
#
|
||||
#engine_type=serial
|
||||
# Zookeeper operations timeout. (integer value)
|
||||
#zk_timeout = 10
|
||||
|
||||
#
|
||||
# Cluster node check timeout. The number of seconds to wait until timing out
|
||||
# status checks on a cluster node.
|
||||
# Default: 10
|
||||
#
|
||||
#cluster_node_check_timeout=10
|
||||
# Board name. (string value)
|
||||
#jobboard_name = cue
|
||||
|
||||
# Engine type. (string value)
|
||||
#engine_type = serial
|
||||
|
||||
# Number of seconds to wait between checks for node status (integer value)
|
||||
#cluster_node_check_timeout = 10
|
||||
|
||||
# Number of times to check a node for status before declaring it FAULTED
|
||||
# (integer value)
|
||||
#cluster_node_check_max_count = 30
|
||||
|
||||
#
|
||||
# Cluster node check max count. The maximum number of times to check a cluster
|
||||
# node for status before declaring the node FAULTED.
|
||||
# Default: 30
|
||||
#
|
||||
#cluster_node_check_max_count=30
|
||||
|
||||
[worker]
|
||||
|
||||
#
|
||||
# Number of worker processes to spawn.
|
||||
# Default: 10
|
||||
# From cue.cmd.worker
|
||||
#
|
||||
#count=10
|
||||
|
||||
# Number of worker processes to spawn (integer value)
|
||||
#count = 10
|
||||
|
|
|
@ -37,6 +37,15 @@ cue.manage =
|
|||
taskflow = cue.manage.taskflow:TaskFlowCommands
|
||||
broker = cue.manage.broker:BrokerCommands
|
||||
|
||||
oslo.config.opts =
|
||||
cue = cue:list_opts
|
||||
cue.api = cue.api:list_opts
|
||||
cue.api.app = cue.api.app:list_opts
|
||||
cue.cmd.worker = cue.cmd.worker:list_opts
|
||||
cue.common.service = cue.common.service:list_opts
|
||||
cue.monitor = cue.monitor:list_opts
|
||||
cue.taskflow = cue.taskflow:list_opts
|
||||
|
||||
[pbr]
|
||||
autodoc_index_modules = True
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/cue/cue.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = cue
|
||||
namespace = cue.api
|
||||
namespace = cue.api.app
|
||||
namespace = cue.common.service
|
||||
namespace = cue.monitor
|
||||
namespace = cue.taskflow
|
||||
namespace = keystonemiddleware.auth_token
|
||||
namespace = oslo.db
|
||||
namespace = oslo.messaging
|
||||
namespace = oslo.log
|
||||
namespace = oslo.policy
|
||||
namespace = oslo.service.service
|
||||
namespace = oslo.service.periodic_task
|
||||
namespace = oslo.service.sslutils
|
|
@ -0,0 +1,9 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/cue/monitor.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = cue
|
||||
namespace = cue.monitor
|
||||
namespace = oslo.db
|
||||
namespace = oslo.messaging
|
||||
namespace = oslo.log
|
||||
namespace = oslo.policy
|
|
@ -0,0 +1,10 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/cue/worker.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = cue
|
||||
namespace = cue.cmd.worker
|
||||
namespace = cue.taskflow
|
||||
namespace = oslo.db
|
||||
namespace = oslo.messaging
|
||||
namespace = oslo.log
|
||||
namespace = oslo.policy
|
|
@ -1,138 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Generate sample configuration for your project.
|
||||
#
|
||||
# Aside from the command line flags, it also respects a config file which
|
||||
# should be named oslo.config.generator.rc and be placed in the same directory.
|
||||
#
|
||||
# You can then export the following variables:
|
||||
# CUE_CONFIG_GENERATOR_EXTRA_MODULES: list of modules to interrogate for options.
|
||||
# CUE_CONFIG_GENERATOR_EXTRA_LIBRARIES: list of libraries to discover.
|
||||
# CUE_CONFIG_GENERATOR_EXCLUDED_FILES: list of files to remove from automatic listing.
|
||||
|
||||
print_hint() {
|
||||
echo "Try \`${0##*/} --help' for more information." >&2
|
||||
}
|
||||
|
||||
PARSED_OPTIONS=$(getopt -n "${0##*/}" -o hb:p:m:l:o: \
|
||||
--long help,base-dir:,package-name:,output-dir:,module:,library: -- "$@")
|
||||
|
||||
if [ $? != 0 ] ; then print_hint ; exit 1 ; fi
|
||||
|
||||
eval set -- "$PARSED_OPTIONS"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
echo "${0##*/} [options]"
|
||||
echo ""
|
||||
echo "options:"
|
||||
echo "-h, --help show brief help"
|
||||
echo "-b, --base-dir=DIR project base directory"
|
||||
echo "-p, --package-name=NAME project package name"
|
||||
echo "-o, --output-dir=DIR file output directory"
|
||||
echo "-m, --module=MOD extra python module to interrogate for options"
|
||||
echo "-l, --library=LIB extra library that registers options for discovery"
|
||||
exit 0
|
||||
;;
|
||||
-b|--base-dir)
|
||||
shift
|
||||
BASEDIR=`echo $1 | sed -e 's/\/*$//g'`
|
||||
shift
|
||||
;;
|
||||
-p|--package-name)
|
||||
shift
|
||||
PACKAGENAME=`echo $1`
|
||||
shift
|
||||
;;
|
||||
-o|--output-dir)
|
||||
shift
|
||||
OUTPUTDIR=`echo $1 | sed -e 's/\/*$//g'`
|
||||
shift
|
||||
;;
|
||||
-m|--module)
|
||||
shift
|
||||
MODULES="$MODULES -m $1"
|
||||
shift
|
||||
;;
|
||||
-l|--library)
|
||||
shift
|
||||
LIBRARIES="$LIBRARIES -l $1"
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
BASEDIR=${BASEDIR:-`pwd`}
|
||||
if ! [ -d $BASEDIR ]
|
||||
then
|
||||
echo "${0##*/}: missing project base directory" >&2 ; print_hint ; exit 1
|
||||
elif [[ $BASEDIR != /* ]]
|
||||
then
|
||||
BASEDIR=$(cd "$BASEDIR" && pwd)
|
||||
fi
|
||||
|
||||
PACKAGENAME=${PACKAGENAME:-$(python setup.py --name)}
|
||||
TARGETDIR=$BASEDIR/$PACKAGENAME
|
||||
if ! [ -d $TARGETDIR ]
|
||||
then
|
||||
echo "${0##*/}: invalid project package name" >&2 ; print_hint ; exit 1
|
||||
fi
|
||||
|
||||
OUTPUTDIR=${OUTPUTDIR:-$BASEDIR/etc}
|
||||
# NOTE(bnemec): Some projects put their sample config in etc/,
|
||||
# some in etc/$PACKAGENAME/
|
||||
if [ -d $OUTPUTDIR/$PACKAGENAME ]
|
||||
then
|
||||
OUTPUTDIR=$OUTPUTDIR/$PACKAGENAME
|
||||
elif ! [ -d $OUTPUTDIR ]
|
||||
then
|
||||
echo "${0##*/}: cannot access \`$OUTPUTDIR': No such file or directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASEDIRESC=`echo $BASEDIR | sed -e 's/\//\\\\\//g'`
|
||||
find $TARGETDIR -type f -name "*.pyc" -delete
|
||||
FILES=$(find $TARGETDIR -type f -name "*.py" ! -path "*/tests/*" ! -path "*/nova/*" \
|
||||
-exec grep -l "Opt(" {} + | sed -e "s/^$BASEDIRESC\///g" | sort -u)
|
||||
|
||||
RC_FILE="`dirname $0`/oslo.config.generator.rc"
|
||||
if test -r "$RC_FILE"
|
||||
then
|
||||
source "$RC_FILE"
|
||||
fi
|
||||
|
||||
for filename in ${CUE_CONFIG_GENERATOR_EXCLUDED_FILES}; do
|
||||
FILES="${FILES[@]/$filename/}"
|
||||
done
|
||||
|
||||
for mod in ${CUE_CONFIG_GENERATOR_EXTRA_MODULES}; do
|
||||
MODULES="$MODULES -m $mod"
|
||||
done
|
||||
|
||||
for lib in ${CUE_CONFIG_GENERATOR_EXTRA_LIBRARIES}; do
|
||||
LIBRARIES="$LIBRARIES -l $lib"
|
||||
done
|
||||
|
||||
export EVENTLET_NO_GREENDNS=yes
|
||||
|
||||
OS_VARS=$(set | sed -n '/^OS_/s/=[^=]*$//gp' | xargs)
|
||||
[ "$OS_VARS" ] && eval "unset \$OS_VARS"
|
||||
DEFAULT_MODULEPATH=cue.openstack.common.config.generator
|
||||
MODULEPATH=${MODULEPATH:-$DEFAULT_MODULEPATH}
|
||||
OUTPUTFILE=$OUTPUTDIR/$PACKAGENAME.conf.sample
|
||||
python -m $MODULEPATH $MODULES $LIBRARIES $FILES > $OUTPUTFILE
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "Can not generate $OUTPUTFILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Hook to allow projects to append custom config file snippets
|
||||
CONCAT_FILES=$(ls $BASEDIR/tools/config/*.conf.sample 2>/dev/null)
|
||||
for CONCAT_FILE in $CONCAT_FILES; do
|
||||
cat $CONCAT_FILE >> $OUTPUTFILE
|
||||
done
|
|
@ -1,2 +0,0 @@
|
|||
export CUE_CONFIG_GENERATOR_EXTRA_LIBRARIES='oslo.db oslo.messaging'
|
||||
export CUE_CONFIG_GENERATOR_EXTRA_MODULES=keystonemiddleware.auth_token
|
6
tox.ini
6
tox.ini
|
@ -35,10 +35,10 @@ commands =
|
|||
{toxinidir}/tools/config/check_uptodate.sh
|
||||
|
||||
[testenv:genconfig]
|
||||
sitepackages = False
|
||||
envdir = {toxworkdir}/venv
|
||||
commands =
|
||||
bash tools/config/generate_sample.sh -b . -p cue -o etc/cue
|
||||
oslo-config-generator --config-file=tools/config/config-generator-cue.conf
|
||||
oslo-config-generator --config-file=tools/config/config-generator-worker.conf
|
||||
oslo-config-generator --config-file=tools/config/config-generator-monitor.conf
|
||||
|
||||
[testenv:venv]
|
||||
setenv = PYTHONHASHSEED=0
|
||||
|
|
Loading…
Reference in New Issue