From 92f266b733a552b33ebadc6df3328d2c43c351cb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 1 May 2022 18:47:03 +0200 Subject: tftp-server: T4353: fix Jinja2 linting errors --- data/templates/tftp-server/default.j2 | 8 ++++++++ data/templates/tftp-server/default.tmpl | 7 ------- src/conf_mode/tftp_server.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 data/templates/tftp-server/default.j2 delete mode 100644 data/templates/tftp-server/default.tmpl diff --git a/data/templates/tftp-server/default.j2 b/data/templates/tftp-server/default.j2 new file mode 100644 index 000000000..b2676e0aa --- /dev/null +++ b/data/templates/tftp-server/default.j2 @@ -0,0 +1,8 @@ +{# j2lint: disable=jinja-variable-format #} +### Autogenerated by tftp_server.py ### +DAEMON_ARGS="--listen --user tftp --address {{ listen_address }} {{ "--create --umask 000" if allow_upload is vyos_defined }} --secure {{ directory }}" +{% if vrf is vyos_defined %} +VRF_ARGS="ip vrf exec {{ vrf }}" +{% else %} +VRF_ARGS="" +{% endif %} diff --git a/data/templates/tftp-server/default.tmpl b/data/templates/tftp-server/default.tmpl deleted file mode 100644 index 56784d467..000000000 --- a/data/templates/tftp-server/default.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -### Autogenerated by tftp_server.py ### -DAEMON_ARGS="--listen --user tftp --address {{ listen_address }} {{ "--create --umask 000" if allow_upload is vyos_defined }} --secure {{ directory }}" -{% if vrf is vyos_defined %} -VRF_ARGS="ip vrf exec {{ vrf }}" -{% else %} -VRF_ARGS="" -{% endif %} diff --git a/src/conf_mode/tftp_server.py b/src/conf_mode/tftp_server.py index 95050624e..c5daccb7f 100755 --- a/src/conf_mode/tftp_server.py +++ b/src/conf_mode/tftp_server.py @@ -98,7 +98,7 @@ def generate(tftpd): config['vrf'] = address_config['vrf'] file = config_file + str(idx) - render(file, 'tftp-server/default.tmpl', config) + render(file, 'tftp-server/default.j2', config) idx = idx + 1 return None -- cgit v1.2.3