merge_configs fails when INI file has no section

Bug #1756101 reported by Doug Szumski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Undecided
Doug Szumski

Bug Description

Issue
-----

merge_configs fails if ini files without sections are merged with the following trace:

  File "/home/doug/kayobe/src/kolla-ansible/ansible/action_plugins/merge_configs.py", line 47, in parse
    super(OverrideConfigParser, self).parse(lineiter)
  File "/home/doug/kayobe/src/kolla-ansible/.tox/py27/lib/python2.7/site-packages/oslo_config/iniparser.py", line 97, in parse
    self._assignment(key, value)
  File "/home/doug/kayobe/src/kolla-ansible/.tox/py27/lib/python2.7/site-packages/oslo_config/iniparser.py", line 31, in _assignment
    self.assignment(key, value)
  File "/home/doug/kayobe/src/kolla-ansible/ansible/action_plugins/merge_configs.py", line 37, in assignment
    cur_value = self._cur_section.get(key)
AttributeError: 'NoneType' object has no attribute 'get'

Expected behavior:
------------------

According to [1], ini file sections are optional so merge_configs should merge ini files without the above failure. If [1] is incorrect this bug is invalid.

[1] https://en.wikipedia.org/wiki/INI_file

Doug Szumski (dszumski)
Changed in kolla-ansible:
assignee: nobody → Doug Szumski (dszumski)
Doug Szumski (dszumski)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

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

Changed in kolla-ansible:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.openstack.org/553508
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=d32c708290dcd0934441687606497f5d133627ab
Submitter: Zuul
Branch: master

commit d32c708290dcd0934441687606497f5d133627ab
Author: Doug Szumski <email address hidden>
Date: Thu Mar 15 16:58:54 2018 +0000

    Support parsing ini files with no sections

    Services such as Zookeeper and Kafka use ini files which do not
    explicitly specify sections. This change supports merging ini
    files with no sections, so that the configuration for these
    services follows the example configuration provided for them
    as closely as possible.

    Closes-Bug: #1756101
    Partially-Implements: blueprint monasca-roles
    Change-Id: I1061729875e5545c7af7d80779f9c2124b6c7134

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 7.0.0.0b2

This issue was fixed in the openstack/kolla-ansible 7.0.0.0b2 development milestone.

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.