From 8db6335bb5b2bbb19ff5fddca104be257ba795c8 Mon Sep 17 00:00:00 2001 From: "Jay S. Bryant" Date: Mon, 28 Aug 2017 11:56:31 -0500 Subject: [PATCH] [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 --- cinder/opts.py | 14 +++++++------- tools/config/generate_cinder_opts.py | 10 ++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cinder/opts.py b/cinder/opts.py index 36c59316ee7..dfbd681b133 100644 --- a/cinder/opts.py +++ b/cinder/opts.py @@ -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, diff --git a/tools/config/generate_cinder_opts.py b/tools/config/generate_cinder_opts.py index eb2c95e706d..1f06d3f430c 100644 --- a/tools/config/generate_cinder_opts.py +++ b/tools/config/generate_cinder_opts.py @@ -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)