[DOC BLD FIX] Make opts sections lowercase

The sections in the cinder/opts.py file that are currently
upper case (I.E. BACKEND) cause a sphinx warning to be
generated.  When we switch to treating warnings as errors
this will break our doc build.

This patch updates the code that generates the cinder/opts.py
file to make sure that all of the section names are lower-case
with the exception of the 'DEFAULT' section.  With this
change in place we will not getting Sphinx warnings during
a doc build from the automatic config file generation.

Change-Id: Ibabbcaf7618623219690a2b27a2e548ea00be9d1
This commit is contained in:
Jay S. Bryant 2017-08-28 11:56:31 -05:00
parent fa98ab3bcf
commit 8db6335bb5
2 changed files with 15 additions and 9 deletions

View File

@ -211,21 +211,21 @@ from cinder.zonemanager import fc_zone_manager as \
def list_opts():
return [
('BACKEND',
('backend',
itertools.chain(
[cinder_cmd_volume.host_opt],
)),
('BRCD_FABRIC_EXAMPLE',
('brcd_fabric_example',
itertools.chain(
cinder_zonemanager_drivers_brocade_brcdfabricopts.
brcd_zone_opts,
)),
('CISCO_FABRIC_EXAMPLE',
('cisco_fabric_example',
itertools.chain(
cinder_zonemanager_drivers_cisco_ciscofabricopts.
cisco_zone_opts,
)),
('COORDINATION',
('coordination',
itertools.chain(
cinder_coordination.coordination_opts,
)),
@ -280,17 +280,17 @@ def list_opts():
cinder_volume_manager.volume_manager_opts,
cinder_wsgi_eventletserver.socket_opts,
)),
('FC-ZONE-MANAGER',
('fc-zone-manager',
itertools.chain(
cinder_zonemanager_drivers_brocade_brcdfczonedriver.brcd_opts,
cinder_zonemanager_drivers_cisco_ciscofczonedriver.cisco_opts,
cinder_zonemanager_fczonemanager.zone_manager_opts,
)),
('KEY_MANAGER',
('key_manager',
itertools.chain(
cinder_keymgr_confkeymgr.key_mgr_opts,
)),
('NOVA_GROUP',
('nova_group',
itertools.chain(
cinder_compute_nova.nova_opts,
cinder_compute_nova.nova_session_opts,

View File

@ -235,8 +235,14 @@ if __name__ == "__main__":
key = lambda x: x[0]))
for key in registered_opts_dict:
section_start_str = (" ('" + key + "',\n"
" itertools.chain(\n")
# NOTE(jsbryant): We need to have 'DEFAULT' in uppercase but any
# other section using uppercase causes a Sphinx warning.
if (key == 'DEFAULT'):
section_start_str = (" ('" + key + "',\n"
" itertools.chain(\n")
else:
section_start_str = (" ('" + key.lower() + "',\n"
" itertools.chain(\n")
opt_file.write(section_start_str)
for item in registered_opts_dict[key]:
_write_item(item)