Empty ini files not outputting correctly

Bug #1303968 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
anvil
Fix Released
Critical
Joshua Harlow

Bug Description

It appears empty configuration files, with values being set on them do not actually result in those values then being output. This appears to be a feature/bug of iniparse and configparser and how it handles the DEFAULT section whereby if the DEFAULT section is not present in the initial document that subsequent modifications to the DEFAULT sections keys and values will not cause a new DEFAULT section to be created (and then output). Since nova.conf.sample recently disappeared and now the handling of this returns an empty string (without a DEFAULT section) we need to add logic that creates a DEFAULT section if it is not present in the initial document to ensure that the keys/values we add/remove/set are actually adjusted and output correctly.

Joshua Harlow (harlowja)
Changed in anvil:
importance: Undecided → Critical
assignee: nobody → Joshua Harlow (harlowja)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to anvil (master)

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

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

Reviewed: https://review.openstack.org/85796
Committed: https://git.openstack.org/cgit/stackforge/anvil/commit/?id=6f47cd92e81126cd888a3d72d81dc967ecc611c1
Submitter: Jenkins
Branch: master

commit 6f47cd92e81126cd888a3d72d81dc967ecc611c1
Author: Joshua Harlow <email address hidden>
Date: Mon Apr 7 12:25:34 2014 -0700

    Fix empty ini files not including DEFAULT section

    Empty files and subsequent modification by adding, removing,
    setting and changing keys then outputting those files seems
    to cause iniparse to ignore the whole DEFAULT section. To fix
    this modify the write() function to correctly output the DEFAULT
    section when it exists (but does not exist in the read data).

    Fixes bug 1303968

    Change-Id: I1b4133bc6f876e9e5e39045f46054db13bd4634f

Changed in anvil:
status: In Progress → Fix Committed
Joshua Harlow (harlowja)
Changed in anvil:
status: Fix Committed → Fix Released
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.