oslo-config-generator does not normalize section names

Bug #1646084 reported by Ihar Hrachyshka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
Fix Released
Low
Victor Morales

Bug Description

If some option listing functions use upper case letters for a section name while others use lower case, then the resulting file gets two separate sections. I think INI file section names are supposed to be case insensitive, and hence the generator should normalize their names to the same case (either upper or lower case) and generate a single section for functions using different cases.

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

For example, the following section functions result in two - 'AGENT' and 'agent' - sections:

def list_base_agent_opts():
    return [
        ('agent', neutron.agent.common.config.AGENT_STATE_OPTS),
    ]

def list_metadata_agent_opts():
    return [
        ('AGENT', neutron.agent.common.config.AGENT_STATE_OPTS)
    ]

affects: neutron → oslo.config
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I agree, we should clean up the names in the generator. It might be useful to emit a warning, too, so that devs realize that mixing case like that is unexpected.

Changed in oslo.config:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Victor Morales (electrocucaracha) wrote :

This sounds like an addition in the _cleanup_opts[1] method. I was thinking how to normalize them but it's hard to define which has to be the right value(upper or lower case).

[1] https://github.com/openstack/oslo.config/blob/master/oslo_config/generator.py#L331-L362

Changed in oslo.config:
assignee: nobody → Victor Morales (electrocucaracha)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

Fix proposed to branch: master
Review: https://review.openstack.org/411924

Changed in oslo.config:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.openstack.org/411924
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=1dbf8879091400c177ab800aaf9760a16eabf968
Submitter: Jenkins
Branch: master

commit 1dbf8879091400c177ab800aaf9760a16eabf968
Author: Victor Morales <email address hidden>
Date: Fri Dec 16 11:16:33 2016 -0600

    Normalize group sections

    The current implementation doesn't distinguish between different
    cases for the group sections. As result, some options are grouped in
    different places or even duplicate their values. This change
    normalize the group sections to lower case with the exception of
    DEFAULT group.

    Change-Id: Ia6bced383d36977005e2bf4532bdca9e9d4fe515
    Closes-Bug: #1646084

Changed in oslo.config:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 3.22.0

This issue was fixed in the openstack/oslo.config 3.22.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.