Handle deprecated opts' group correctly

Config generator is changed to use the option's group instead of just
'DEFAULT' if deprecated_group is not specified but deprecated_name is.

Change-Id: Icdf00ed70dd6133cb76d31f6f26a8f3d9a3874b4
Closes-bug: #1523958
This commit is contained in:
Vladyslav Drok 2015-12-08 20:16:47 +02:00
parent 9dbd14e551
commit c5a8008b4d
2 changed files with 21 additions and 17 deletions

View File

@ -489,13 +489,12 @@
# value)
#protocol=http
# Time interval (in seconds) for successive awake call
# to AMT interface, this depends on the IdleTimeout
# setting on AMT interface. AMT Interface will go to
# sleep after 60 seconds of inactivity by default.
# IdleTimeout=0 means AMT will not go to sleep at all.
# Setting awake_interval=0 will disable awake call. (integer
# value)
# Time interval (in seconds) for successive awake call to AMT
# interface, this depends on the IdleTimeout setting on AMT
# interface. AMT Interface will go to sleep after 60 seconds
# of inactivity by default. IdleTimeout=0 means AMT will not
# go to sleep at all. Setting awake_interval=0 will disable
# awake call. (integer value)
#awake_interval=60
@ -583,6 +582,17 @@
[conductor]
#
# Options defined in ironic.conductor.base_manager
#
# The size of the workers greenthread pool. (integer value)
#workers_pool_size=100
# Seconds between conductor heart beats. (integer value)
#heartbeat_interval=10
#
# Options defined in ironic.conductor.manager
#
@ -592,9 +602,6 @@
# value)
#api_url=<None>
# Seconds between conductor heart beats. (integer value)
#heartbeat_interval=10
# Maximum time (in seconds) since the last check-in of a
# conductor. A conductor is considered inactive when this time
# has been exceeded. (integer value)
@ -628,9 +635,6 @@
# thread pool size. (integer value)
#periodic_max_workers=8
# The size of the workers greenthread pool. (integer value)
#workers_pool_size=100
# Number of attempts to grab a node lock. (integer value)
#node_locked_retry_attempts=3
@ -1343,7 +1347,7 @@
# Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached
# in-process. (list value)
# Deprecated group/name - [DEFAULT]/memcache_servers
# Deprecated group/name - [keystone_authtoken]/memcache_servers
#memcached_servers=<None>
# In order to prevent excessive effort spent validating

View File

@ -221,7 +221,7 @@ def print_group_opts(group, opts_by_module):
print('#')
print('')
for opt in opts:
_print_opt(opt)
_print_opt(opt, group)
print('')
@ -263,7 +263,7 @@ def _sanitize_default(name, value):
return value
def _print_opt(opt):
def _print_opt(opt, group):
opt_name, opt_default, opt_help = opt.dest, opt.default, opt.help
if not opt_help:
sys.stderr.write('WARNING: "%s" is missing help string.\n' % opt_name)
@ -281,7 +281,7 @@ def _print_opt(opt):
deprecated_name = (deprecated_opt.name if
deprecated_opt.name else opt_name)
deprecated_group = (deprecated_opt.group if
deprecated_opt.group else "DEFAULT")
deprecated_opt.group else group)
print('# Deprecated group/name - [%s]/%s' %
(deprecated_group,
deprecated_name))