From b6a307424451b197d57265f17692ba2033a0ff7f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 1 May 2022 20:28:34 +0200 Subject: igmp-proxy: T4353: fix Jinja2 linting errors --- data/templates/igmp-proxy/igmpproxy.conf.j2 | 40 +++++++++++++++++++++++++++ data/templates/igmp-proxy/igmpproxy.conf.tmpl | 40 --------------------------- src/conf_mode/igmp_proxy.py | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 data/templates/igmp-proxy/igmpproxy.conf.j2 delete mode 100644 data/templates/igmp-proxy/igmpproxy.conf.tmpl diff --git a/data/templates/igmp-proxy/igmpproxy.conf.j2 b/data/templates/igmp-proxy/igmpproxy.conf.j2 new file mode 100644 index 000000000..ab3c9fd31 --- /dev/null +++ b/data/templates/igmp-proxy/igmpproxy.conf.j2 @@ -0,0 +1,40 @@ +######################################################## +# +# autogenerated by igmp_proxy.py +# +# The configuration file must define one upstream interface, and one or more +# downstream interfaces. +# +# If multicast traffic originates outside the upstream subnet, the "altnet" +# option can be used in order to define legal multicast sources. +# +# The "quickleave" should be used to avoid saturation of the upstream link. The +# option should only be used if it's absolutely nessecary to accurately imitate +# just one Client. +# +######################################################## + +{% if disable_quickleave is not vyos_defined %} +quickleave +{% endif %} +{% if interface is vyos_defined %} +{% for iface, config in interface.items() %} + +# Configuration for {{ iface }} ({{ config.role }} interface) +{% if config.role is vyos_defined('disabled') %} +phyint {{ iface }} disabled +{% else %} +phyint {{ iface }} {{ config.role }} ratelimit 0 threshold {{ config.threshold }} +{% endif %} +{% if config.alt_subnet is vyos_defined %} +{% for subnet in config.alt_subnet %} + altnet {{ subnet }} +{% endfor %} +{% endif %} +{% if config.whitelist is vyos_defined %} +{% for subnet in config.whitelist %} + whitelist {{ subnet }} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} diff --git a/data/templates/igmp-proxy/igmpproxy.conf.tmpl b/data/templates/igmp-proxy/igmpproxy.conf.tmpl deleted file mode 100644 index f32d68e43..000000000 --- a/data/templates/igmp-proxy/igmpproxy.conf.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -######################################################## -# -# autogenerated by igmp_proxy.py -# -# The configuration file must define one upstream interface, and one or more -# downstream interfaces. -# -# If multicast traffic originates outside the upstream subnet, the "altnet" -# option can be used in order to define legal multicast sources. -# -# The "quickleave" should be used to avoid saturation of the upstream link. The -# option should only be used if it's absolutely nessecary to accurately imitate -# just one Client. -# -######################################################## - -{% if disable_quickleave is not vyos_defined %} -quickleave -{% endif %} -{% if interface is vyos_defined %} -{% for iface, config in interface.items() %} - -# Configuration for {{ iface }} ({{ config.role }} interface) -{% if config.role is vyos_defined('disabled') %} -phyint {{ iface }} disabled -{% else %} -phyint {{ iface }} {{ config.role }} ratelimit 0 threshold {{ config.threshold }} -{% endif %} -{% if config.alt_subnet is vyos_defined %} -{% for subnet in config.alt_subnet %} - altnet {{ subnet }} -{% endfor %} -{% endif %} -{% if config.whitelist is vyos_defined %} -{% for subnet in config.whitelist %} - whitelist {{ subnet }} -{% endfor %} -{% endif %} -{% endfor %} -{% endif %} diff --git a/src/conf_mode/igmp_proxy.py b/src/conf_mode/igmp_proxy.py index 37df3dc92..de6a51c64 100755 --- a/src/conf_mode/igmp_proxy.py +++ b/src/conf_mode/igmp_proxy.py @@ -96,7 +96,7 @@ def generate(igmp_proxy): Warning('IGMP Proxy will be deactivated because it is disabled') return None - render(config_file, 'igmp-proxy/igmpproxy.conf.tmpl', igmp_proxy) + render(config_file, 'igmp-proxy/igmpproxy.conf.j2', igmp_proxy) return None -- cgit v1.2.3