diff options
author | Christian Poessinger <christian@poessinger.com> | 2018-09-10 18:22:26 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2018-09-10 18:24:49 +0200 |
commit | 9fde738774b826ab18d235ab0fb7e2b3c7d9998a (patch) | |
tree | 493170d27eaad73b12fcbf2881e55452845eae6c | |
parent | 05e275a1503a4ddd4485b15519c0779fbd095a56 (diff) | |
download | vyos-1x-9fde738774b826ab18d235ab0fb7e2b3c7d9998a.tar.gz vyos-1x-9fde738774b826ab18d235ab0fb7e2b3c7d9998a.zip |
snmp.py: improve JINJA2 template robustness
-rwxr-xr-x | src/conf_mode/snmp.py | 2 |
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 %} |