aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-02-29 10:14:22 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-02-29 16:18:36 +0100
commit04804c49eefd80efb0f31b27b56192ee4c77081b (patch)
tree7c756f99bcc99d99671a3b65e2b52d6e7b6bcf83 /src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2
parentd3591ef0893a8b718042b3a7937bb1f73d972176 (diff)
Avoid empty newlines in jina templates when if conditions evaluate to false
- avoid empty newlines for false if statements - this is useful for the logging of the rendered objects in tests Issue-ID: TEST-417 Change-Id: Iaeec217c87e73e316c4ef468007369facbf9a02f Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2')
-rw-r--r--src/onapsdk/sdnc/templates/create_node_netconf_api.json.j26
1 files changed, 3 insertions, 3 deletions
diff --git a/src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2 b/src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2
index 26d4c51..70127a6 100644
--- a/src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2
+++ b/src/onapsdk/sdnc/templates/create_node_netconf_api.json.j2
@@ -9,21 +9,21 @@
{%- elif key == "netconf-node-topology:port" %}"{{key}}": {{port_}}
{%- elif key == "netconf-node-topology:username" %}"{{key}}": "{{username_}}"
{%- elif key == "netconf-node-topology:password" %}"{{key}}": "{{password_}}"
- {%- else %}"{{key}}":
+ {% else %}"{{key}}":
{%- if value is number %}{{value}}
{%- elif value is boolean %}{{value}}
{%- elif value is string %}{{value}}
{%- elif value is mapping %}{{value|replace("'",'"')|replace("True","true")|replace("False","false")}}
{%- endif %}
{%- endif %}
- {%- else %}
+ {% else %}
{%- if key == "node-id" %}
"{{key}}": "{{node_id}}",
{%- elif key == "netconf-node-topology:host" %}"{{key}}": "{{host_}}",
{%- elif key == "netconf-node-topology:port" %}"{{key}}": {{port_}},
{%- elif key == "netconf-node-topology:username" %}"{{key}}": "{{username_}}",
{%- elif key == "netconf-node-topology:password" %}"{{key}}": "{{password_}}",
- {%- else %}"{{key}}":
+ {% else %}"{{key}}":
{%- if value is number %}{{value}},
{%- elif value is boolean %}{{value|replace("True","true")}},
{%- elif value is string %}"{{value}}",