Correct invalid jinja set

This change corrects an issue with the jinja expression at the
top of the file which is resulting in a stacktrace when the
set attempts to update an object of the same name, which results
in a none type.

This change also updates the jinja expression at the top of the
file making it more legible.

Change-Id: Ia3334c5d8a20bb3c0bc721a266a09b6c01fe7c4d
Closes-Bug: #1856918
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2019-12-18 20:34:19 -06:00 committed by Kevin Carter (cloudnull)
parent b1743c3bce
commit d088cf66be
1 changed files with 8 additions and 9 deletions

View File

@ -1,12 +1,11 @@
{%- set _service_nets = {} -%}
{%- for network in networks if network.enabled|default(true) -%}
{%- if network.service_net_map_replace is defined -%}
{%- set _service_nets = _service_nets.update({network.service_net_map_replace:network.name_lower}) -%}
{%- else -%}
{%- set _service_nets = _service_nets.update({network.name_lower:network.name_lower}) -%}
{%- endif -%}
{%- endfor -%}
{% set _service_nets = {} %}
{% for network in networks if network.enabled|default(true) %}
{% if network.service_net_map_replace is defined %}
{% set _ = _service_nets.update({network.service_net_map_replace:network.name_lower}) %}
{% else %}
{% set _ = _service_nets.update({network.name_lower:network.name_lower}) %}
{% endif %}
{% endfor %}
heat_template_version: rocky
description: >