← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1568820] Re: Duplicate sections in generated config

 

Reviewed:  https://review.openstack.org/304802
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=01ed4fccf27ef32449bfe3d36af754c8659d0720
Submitter: Jenkins
Branch:    master

commit 01ed4fccf27ef32449bfe3d36af754c8659d0720
Author: Ben Nemec <bnemec@xxxxxxxxxx>
Date:   Tue Apr 12 17:54:45 2016 +0000

    Avoid duplicate sections in generator output
    
    Because option groups can be specified as either bare strings or
    OptGroup objects, it is possible to end up with duplicate sections
    in the resulting output file.  This is confusing, and can cause
    problems for config management systems so we should avoid doing it.
    
    This change avoids the dupes by always keying the group list on
    the group name, but including the OptGroup object in the data
    when available so the output code can make use of the extra
    information in an OptGroup.
    
    Co-Authored-By: Alexis Lee <lxsli@xxxxxxx>
    Change-Id: I2cd8ae87a1f573b5837d292abcf7babf5d88bee5
    Closes-Bug: 1568820


** Changed in: oslo.config
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1568820

Title:
  Duplicate sections in generated config

Status in OpenStack Compute (nova):
  In Progress
Status in oslo.config:
  Fix Released

Bug description:
  nova.conf as generated by oslo.config (for nova f05bbb1279598fa82ff5694e35d9de96315b1916) contains duplicate neutron and xenserver sections
  # PYTHONPATH=. oslo-config-generator --config-file=etc/nova/nova-config-generator.conf ; grep "^\[" etc/nova/nova.conf.sample | sort | uniq -c | grep " 2 "
        2 [neutron]
        2 [xenserver]

  This appears to be because there groups are being registered with both
  oslo_config.cfg.OptGroup and str in places

  e.g. 
  http://git.openstack.org/cgit/openstack/nova/tree/nova/api/metadata/handler.py
      CONF.register_opts(metadata_proxy_opts, 'neutron')

  and
  http://git.openstack.org/cgit/openstack/nova/tree/nova/conf/neutron.py
      neutron_group = cfg.OptGroup('neutron', title='Neutron Options')
      conf.register_group(neutron_group)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1568820/+subscriptions