config_template fails to set a key, if key already exists in template as a comment

Bug #1889547 reported by Jan Marquardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Dmitriy Rabotyagov

Bug Description

I came across this issue while I was trying to configure designate with openstack-ansible. I wanted to set enabled_notification_handlers by designate_designate_conf_overrides, but the key/value never showed up as expected in /etc/designate/designate.conf.

After some testing I found this is caused by the existing comment

#enabled_notification_handlers =

in os_designate/templates/designate.conf.j2. When I remove this comment, the override works as intended.

Changed in openstack-ansible:
status: New → Confirmed
assignee: nobody → Dmitriy Rabotyagov (noonedeadpunk)
importance: Undecided → High
Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

What makes things weirder, is that it's reproducible only for non-default section.
Looking into it

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-config_template (master)

Fix proposed to branch: master
Review: https://review.opendev.org/744023

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

Reviewed: https://review.opendev.org/744023
Committed: https://git.openstack.org/cgit/openstack/ansible-config_template/commit/?id=ea07ed008fe896b8c9812bd14785dbfa4fca0679
Submitter: Zuul
Branch: master

commit ea07ed008fe896b8c9812bd14785dbfa4fca0679
Author: Dmitriy Rabotyagov <email address hidden>
Date: Thu Jul 30 20:18:07 2020 +0300

    Fix section overrides when commented option persist

    In cases, when key already exist, but commented out without space
    (ie "#key) and is not in default section, it's not updated with
    sectdict.insert statement. That is possible happens because
    self._sections keys are protected and can't be overwritten (at least
    new assignment makes no difference)

    Change-Id: Ie0c588a2d559bd38c68b3d018e547a036d83214c
    Closes-Bug: #1889547

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

This issue was fixed in the openstack/ansible-config_template 1.2.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.