diff --git a/salt/bpf/macros.jinja b/salt/bpf/macros.jinja index 38cb8ed0d..1fcb1af7c 100644 --- a/salt/bpf/macros.jinja +++ b/salt/bpf/macros.jinja @@ -1,10 +1,12 @@ {% macro remove_comments(bpfmerged, app) %} {# remove comments from the bpf #} +{% set app_list = [] %} {% for bpf in bpfmerged[app] %} -{% if bpf.strip().startswith('#') %} -{% do bpfmerged[app].pop(loop.index0) %} +{% if not bpf.strip().startswith('#') %} +{% do app_list.append(bpf) %} {% endif %} {% endfor %} +{% do bpfmerged.update({app: app_list}) %} {% endmacro %}