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

View File

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