summaryrefslogtreecommitdiff
path: root/src/conf_mode/snmp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-09-10 18:22:26 +0200
committerChristian Poessinger <christian@poessinger.com>2018-09-10 18:24:49 +0200
commit9fde738774b826ab18d235ab0fb7e2b3c7d9998a (patch)
tree493170d27eaad73b12fcbf2881e55452845eae6c /src/conf_mode/snmp.py
parent05e275a1503a4ddd4485b15519c0779fbd095a56 (diff)
downloadvyos-1x-9fde738774b826ab18d235ab0fb7e2b3c7d9998a.tar.gz
vyos-1x-9fde738774b826ab18d235ab0fb7e2b3c7d9998a.zip
snmp.py: improve JINJA2 template robustness
Diffstat (limited to 'src/conf_mode/snmp.py')
-rwxr-xr-xsrc/conf_mode/snmp.py2
1 files changed, 2 insertions, 0 deletions
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 %}