aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templating/templates/switches.txt7
-rwxr-xr-xtemplating/templating.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/templating/templates/switches.txt b/templating/templates/switches.txt
index 957df02..0cc203b 100644
--- a/templating/templates/switches.txt
+++ b/templating/templates/switches.txt
@@ -1,2 +1,7 @@
-{% for switch in objects["public/switches"].switches %}Switch {{ switch }}: {{ objects["read/switches-management"].switches[switch].mgmt_v4_addr }}
+{% for switch in objects["public/switches"].switches %}
+ {% set mg = objects["read/switches-management"].switches[switch] %}
+ {% set s = objects["public/switches"].switches[switch] %}
+ {% if mg.subnet4 -%}
+ {{ switch }} {{mg.subnet4 }} {{ mg.subnet6 }} {{ mg.mgmt_v4_addr }} {{ mg.mgmt_v6_addr }} {{ mg.traffic_vlan }} {{ s.distro_name }}
+ {% endif %}
{% endfor %}
diff --git a/templating/templating.py b/templating/templating.py
index 2c1259a..5144b89 100755
--- a/templating/templating.py
+++ b/templating/templating.py
@@ -17,7 +17,7 @@ def updateData():
for a in endpoints:
objects[a] = getEndpoint(a)
-env = Environment(loader=FileSystemLoader(['templates/','/opt/gondul/templating/templates']))
+env = Environment(loader=FileSystemLoader(['templates/','/opt/gondul/templating/templates']),lstrip_blocks=True, trim_blocks=True)
import http.server
class MyHandler(http.server.BaseHTTPRequestHandler):