From ceb9cea2344c963865ec5a2b3a5d3f6a5d98c541 Mon Sep 17 00:00:00 2001 From: Henk Hesselink Date: Fri, 5 Mar 2021 18:08:09 -0800 Subject: [PATCH] fix prev. delta: jinja does not have isinstance --- snmp/macros.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snmp/macros.jinja b/snmp/macros.jinja index 8e4b593..ca41416 100644 --- a/snmp/macros.jinja +++ b/snmp/macros.jinja @@ -4,14 +4,14 @@ {%- macro v12c_communities(mode, proto='') -%} {% set communities = conf.get(mode+'communities'+proto, []) -%} {%- for community in communities %} - {%- if isinstance(communities, dict) and communities.get(community, {}) is mapping %} + {%- if communities is mapping and communities.get(community, {}) is mapping %} {%- set source = communities.get(community).get('source', '') %} {%- set view = communities.get(community).get('view', None) %} {%- else %} {%- set source = '' %} {%- set view = '' %} {%- endif %} - {%- if not isinstance(source, (tuple, list)) %} + {%- if source is not sequence or source is mapping or source is string %} {%- set source = [source] %} {%- endif %} {%- for src in source -%}