From: Alexandru Avadanii Date: Wed, 24 Jan 2018 21:47:52 +0000 (+0100) Subject: [daisy] network template: Fix set inside loop X-Git-Tag: 6.0.0~6 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F51077%2F3;p=pharos.git [daisy] network template: Fix set inside loop Previous implementation fails in older versions of py-jinja2. See related bug reports [1, 2]. Since `networks.update` on its own is enough, stop assigning its result back to 'networks'. [1] https://github.com/pallets/jinja/issues/641 [2] https://github.com/pallets/jinja/issues/164 Change-Id: I303388223bdec9ae43e49d988aee41b5b47c1562 Signed-off-by: Alexandru Avadanii --- diff --git a/config/installers/daisy/network.yaml.j2 b/config/installers/daisy/network.yaml.j2 index 1fad1ac8..f976ab73 100644 --- a/config/installers/daisy/network.yaml.j2 +++ b/config/installers/daisy/network.yaml.j2 @@ -72,7 +72,8 @@ networks: {%- set gateway = ".".join([ips[0], ips[1], ips[2], "1"]) -%} {%- endif -%} - {%- set networks = networks.update({key: {'interface_name': interface_name, + {#- set v=v.update(...) is unpredictable and breaks in older j2 -#} + {%- set _ = networks.update({key: {'interface_name': interface_name, 'bus_addr': bus_addr, 'vlan': vlan, 'network': network,