From cb014d8818a864512680f57953d6f21ad5467e59 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 16 Apr 2022 12:14:43 +0200 Subject: dhcp(v6)-relay: T4353: fix Jinja2 linting errors --- data/templates/dhcp-relay/dhcrelay.conf.j2 | 6 ++++++ data/templates/dhcp-relay/dhcrelay.conf.tmpl | 6 ------ data/templates/dhcp-relay/dhcrelay6.conf.j2 | 21 +++++++++++++++++++++ data/templates/dhcp-relay/dhcrelay6.conf.tmpl | 21 --------------------- 4 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 data/templates/dhcp-relay/dhcrelay.conf.j2 delete mode 100644 data/templates/dhcp-relay/dhcrelay.conf.tmpl create mode 100644 data/templates/dhcp-relay/dhcrelay6.conf.j2 delete mode 100644 data/templates/dhcp-relay/dhcrelay6.conf.tmpl (limited to 'data/templates/dhcp-relay') diff --git a/data/templates/dhcp-relay/dhcrelay.conf.j2 b/data/templates/dhcp-relay/dhcrelay.conf.j2 new file mode 100644 index 000000000..11710bd8e --- /dev/null +++ b/data/templates/dhcp-relay/dhcrelay.conf.j2 @@ -0,0 +1,6 @@ +### Autogenerated by dhcp_relay.py ### + +{% set max_size = '-A ' ~ relay_options.max_size if relay_options.max_size is vyos_defined %} +{# hop_count and relay_agents_packets is a default option, thus it is always present #} +OPTIONS="-c {{ relay_options.hop_count }} -a -m {{ relay_options.relay_agents_packets }} {{ max_size }} -i {{ interface | join(' -i ') }} {{ server | join(' ') }}" + diff --git a/data/templates/dhcp-relay/dhcrelay.conf.tmpl b/data/templates/dhcp-relay/dhcrelay.conf.tmpl deleted file mode 100644 index 11710bd8e..000000000 --- a/data/templates/dhcp-relay/dhcrelay.conf.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -### Autogenerated by dhcp_relay.py ### - -{% set max_size = '-A ' ~ relay_options.max_size if relay_options.max_size is vyos_defined %} -{# hop_count and relay_agents_packets is a default option, thus it is always present #} -OPTIONS="-c {{ relay_options.hop_count }} -a -m {{ relay_options.relay_agents_packets }} {{ max_size }} -i {{ interface | join(' -i ') }} {{ server | join(' ') }}" - diff --git a/data/templates/dhcp-relay/dhcrelay6.conf.j2 b/data/templates/dhcp-relay/dhcrelay6.conf.j2 new file mode 100644 index 000000000..6365346b4 --- /dev/null +++ b/data/templates/dhcp-relay/dhcrelay6.conf.j2 @@ -0,0 +1,21 @@ +### Autogenerated by dhcpv6_relay.py ### + +{# upstream_interface is mandatory so it's always present #} +{% set upstream = namespace(value='') %} +{% for interface, config in upstream_interface.items() %} +{% for address in config.address %} +{% set upstream.value = upstream.value ~ '-u ' ~ address ~ '%' ~ interface ~ ' ' %} +{% endfor %} +{% endfor %} +{# listen_interface is mandatory so it's always present #} +{% set listen = namespace(value='') %} +{% for interface, config in listen_interface.items() %} +{% if config.address is vyos_defined %} +{% set listen.value = listen.value ~ '-l ' ~ config.address ~ '%' ~ interface ~ ' ' %} +{% else %} +{% set listen.value = listen.value ~ '-l ' ~ interface ~ ' ' %} +{% endif %} +{% endfor %} + +OPTIONS="{{ listen.value }} {{ upstream.value }} -c {{ max_hop_count }} {{ '-I' if use_interface_id_option is vyos_defined }}" + diff --git a/data/templates/dhcp-relay/dhcrelay6.conf.tmpl b/data/templates/dhcp-relay/dhcrelay6.conf.tmpl deleted file mode 100644 index 1fd5de18c..000000000 --- a/data/templates/dhcp-relay/dhcrelay6.conf.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -### Autogenerated by dhcpv6_relay.py ### - -{# upstream_interface is mandatory so it's always present #} -{% set upstream = namespace(value='') %} -{% for interface, config in upstream_interface.items() %} -{% for address in config.address %} -{% set upstream.value = upstream.value ~ '-u ' ~ address ~ '%' ~ interface ~ ' ' %} -{% endfor %} -{% endfor %} -{# listen_interface is mandatory so it's always present #} -{% set listen = namespace(value='') %} -{% for interface, config in listen_interface.items() %} -{% if config.address is vyos_defined %} -{% set listen.value = listen.value ~ '-l ' ~ config.address ~ '%' ~ interface ~ ' ' %} -{% else %} -{% set listen.value = listen.value ~ '-l ' ~ interface ~ ' ' %} -{% endif %} -{% endfor %} - -OPTIONS="{{ listen.value }} {{ upstream.value }} -c {{ max_hop_count }} {{ '-I' if use_interface_id_option is vyos_defined }}" - -- cgit v1.2.3