Fix configuration generation for ironic doc pages

Ironic's sample configuration page previously did not render any
of the items in the default section, except for those items added
by other libraries. This was because we were trying to use an iterator
instead of a list.

Using an iterator, in theory should have worked, and did work for
normal invocations, but didn't work when it came to sphinx generated
output.

Instead of trying to use itertools to assemble everything, we just
now instead assemble the list and use a list_opts method like some
of the other more complex groups to add values.

Confirmed in local build output that the sphinx generated output
works as expected now.

Change-Id: I7f1cffb2a91728ab632ab0ccaa6acbb7e86fb533
This commit is contained in:
Julia Kreger 2021-03-29 15:53:25 -07:00
parent b748ff6529
commit 12d1dd5309
2 changed files with 23 additions and 18 deletions

View File

@ -424,6 +424,28 @@ webserver_opts = [
]
def list_opts():
_default_opt_lists = [
api_opts,
driver_opts,
exc_log_opts,
hash_opts,
image_opts,
img_cache_opts,
netconf_opts,
notification_opts,
path_opts,
portgroup_opts,
service_opts,
utils_opts,
webserver_opts,
]
full_opt_list = []
for options in _default_opt_lists:
full_opt_list.extend(options)
return full_opt_list
def register_opts(conf):
conf.register_opts(api_opts)
conf.register_opts(driver_opts)

View File

@ -10,30 +10,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import itertools
from oslo_log import log
import ironic.conf
_default_opt_lists = [
ironic.conf.default.api_opts,
ironic.conf.default.driver_opts,
ironic.conf.default.exc_log_opts,
ironic.conf.default.hash_opts,
ironic.conf.default.image_opts,
ironic.conf.default.img_cache_opts,
ironic.conf.default.netconf_opts,
ironic.conf.default.notification_opts,
ironic.conf.default.path_opts,
ironic.conf.default.portgroup_opts,
ironic.conf.default.service_opts,
ironic.conf.default.utils_opts,
ironic.conf.default.webserver_opts,
]
_opts = [
('DEFAULT', itertools.chain(*_default_opt_lists)),
('DEFAULT', ironic.conf.default.list_opts()),
('agent', ironic.conf.agent.opts),
('ansible', ironic.conf.ansible.opts),
('api', ironic.conf.api.opts),