From 9fde738774b826ab18d235ab0fb7e2b3c7d9998a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 10 Sep 2018 18:22:26 +0200 Subject: snmp.py: improve JINJA2 template robustness --- src/conf_mode/snmp.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index 3eb2935be..051b58cc4 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -138,6 +138,7 @@ agentaddress unix:/run/snmpd.socket{% if listen_on %}{% for li in listen_on %},{ # SNMP communities {%- for c in communities %} +{%- if c.authorization %} {%- for network in c.network_v4 %} {{ c.authorization }}community {{ c.name }} {{ network }} {%- endfor %} @@ -147,6 +148,7 @@ agentaddress unix:/run/snmpd.socket{% if listen_on %}{% for li in listen_on %},{ {%- else %} {{ c.authorization }}community {{ c.name }} {{ c.authorization }}community6 {{ c.name }} +{%- endif %} {%- endfor %} {% if contact %} -- cgit v1.2.3