Missing newline in nova.conf template for spice

Bug #2052884 reported by Cees Moerkerken
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

In the file openstack-ansible-os_nova/templates/nova.conf.j2 at the section for [spice], the template contains:

  html5proxy_host = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}
  server_listen = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}
  server_proxyclient_address = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}

The line break between these lines is lost when the {% endif %} directive is processed so the nova.conf file contains:

  html5proxy_host = 192.168.1.2server_listen = 192.168.1.2server_proxyclient_address = 192.168.1.2

when it should be separated by newlines.

in #1988337 this was fixed by changing
  {% endif %}
to
  {% endif +%}

However the behavior of openstack.config_template.config_template differs from the default jinja templating behavior one would assume when using ansible. So it might be better to fix it there although that would of course cause all config files to get the additional linebreaks that are now missing.

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

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/908748
Committed: https://opendev.org/openstack/openstack-ansible-os_nova/commit/b78e8a68ea9f20e1220847ccae8e73604ee50ab7
Submitter: "Zuul (22348)"
Branch: master

commit b78e8a68ea9f20e1220847ccae8e73604ee50ab7
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sun Feb 11 17:36:15 2024 +0100

    Evaluate my_ip address once

    Instead of evaluating same condition of my_ip in multiple places across
    the role this patch suggests doing this once in vars and using the
    resulting variable afterwards.

    This not only reduce amount of evaluations made throughout the role runtime,
    but also solves possible corner cases where some syntax may go off.

    Closes-Bug: #2052884
    Change-Id: I454b53713ecacf844ac14f77b6d1e1adc1322c0e

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_nova (stable/2023.2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_nova (stable/2023.1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_nova (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/908698
Committed: https://opendev.org/openstack/openstack-ansible-os_nova/commit/fc351685772ec20749724deb41e95b115840f204
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit fc351685772ec20749724deb41e95b115840f204
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sun Feb 11 17:36:15 2024 +0100

    Evaluate my_ip address once

    Instead of evaluating same condition of my_ip in multiple places across
    the role this patch suggests doing this once in vars and using the
    resulting variable afterwards.

    This not only reduce amount of evaluations made throughout the role runtime,
    but also solves possible corner cases where some syntax may go off.

    Closes-Bug: #2052884
    Change-Id: I454b53713ecacf844ac14f77b6d1e1adc1322c0e
    (cherry picked from commit b78e8a68ea9f20e1220847ccae8e73604ee50ab7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_nova (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/908699
Committed: https://opendev.org/openstack/openstack-ansible-os_nova/commit/cb97be032d4880652b16864e93cda75527f34ac6
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit cb97be032d4880652b16864e93cda75527f34ac6
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sun Feb 11 17:36:15 2024 +0100

    Evaluate my_ip address once

    Instead of evaluating same condition of my_ip in multiple places across
    the role this patch suggests doing this once in vars and using the
    resulting variable afterwards.

    This not only reduce amount of evaluations made throughout the role runtime,
    but also solves possible corner cases where some syntax may go off.

    Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/910220
    Closes-Bug: #2052884
    Change-Id: I454b53713ecacf844ac14f77b6d1e1adc1322c0e
    (cherry picked from commit b78e8a68ea9f20e1220847ccae8e73604ee50ab7)

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.