From 59290c857237912dc5cc67733622e2604f1ff30a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 1 May 2022 19:53:25 +0200 Subject: system-options: T4353: fix Jinja2 linting errors --- data/templates/system/curlrc.j2 | 6 ++++++ data/templates/system/curlrc.tmpl | 6 ------ data/templates/system/ssh_config.j2 | 3 +++ data/templates/system/ssh_config.tmpl | 3 --- data/templates/system/sysctl.conf.j2 | 7 +++++++ data/templates/system/sysctl.conf.tmpl | 7 ------- src/conf_mode/system-option.py | 4 ++-- src/conf_mode/system_sysctl.py | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 data/templates/system/curlrc.j2 delete mode 100644 data/templates/system/curlrc.tmpl create mode 100644 data/templates/system/ssh_config.j2 delete mode 100644 data/templates/system/ssh_config.tmpl create mode 100644 data/templates/system/sysctl.conf.j2 delete mode 100644 data/templates/system/sysctl.conf.tmpl diff --git a/data/templates/system/curlrc.j2 b/data/templates/system/curlrc.j2 new file mode 100644 index 000000000..be4efe8ba --- /dev/null +++ b/data/templates/system/curlrc.j2 @@ -0,0 +1,6 @@ +{% if http_client.source_interface is vyos_defined %} +--interface "{{ http_client.source_interface }}" +{% endif %} +{% if http_client.source_address is vyos_defined %} +--interface "{{ http_client.source_address }}" +{% endif %} diff --git a/data/templates/system/curlrc.tmpl b/data/templates/system/curlrc.tmpl deleted file mode 100644 index be4efe8ba..000000000 --- a/data/templates/system/curlrc.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -{% if http_client.source_interface is vyos_defined %} ---interface "{{ http_client.source_interface }}" -{% endif %} -{% if http_client.source_address is vyos_defined %} ---interface "{{ http_client.source_address }}" -{% endif %} diff --git a/data/templates/system/ssh_config.j2 b/data/templates/system/ssh_config.j2 new file mode 100644 index 000000000..1449f95b1 --- /dev/null +++ b/data/templates/system/ssh_config.j2 @@ -0,0 +1,3 @@ +{% if ssh_client.source_address is vyos_defined %} +BindAddress {{ ssh_client.source_address }} +{% endif %} diff --git a/data/templates/system/ssh_config.tmpl b/data/templates/system/ssh_config.tmpl deleted file mode 100644 index 1449f95b1..000000000 --- a/data/templates/system/ssh_config.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -{% if ssh_client.source_address is vyos_defined %} -BindAddress {{ ssh_client.source_address }} -{% endif %} diff --git a/data/templates/system/sysctl.conf.j2 b/data/templates/system/sysctl.conf.j2 new file mode 100644 index 000000000..59a19e157 --- /dev/null +++ b/data/templates/system/sysctl.conf.j2 @@ -0,0 +1,7 @@ +# autogenerated by system_sysctl.py + +{% if parameter is vyos_defined %} +{% for k, v in parameter.items() %} +{{ k }} = {{ v.value }} +{% endfor %} +{% endif %} diff --git a/data/templates/system/sysctl.conf.tmpl b/data/templates/system/sysctl.conf.tmpl deleted file mode 100644 index 3aa857647..000000000 --- a/data/templates/system/sysctl.conf.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -# autogenerated by system_sysctl.py - -{% if parameter is vyos_defined %} -{% for k, v in parameter.items() %} -{{ k }} = {{ v.value }} -{% endfor %} -{% endif %} diff --git a/src/conf_mode/system-option.py b/src/conf_mode/system-option.py index b1c63e316..36dbf155b 100755 --- a/src/conf_mode/system-option.py +++ b/src/conf_mode/system-option.py @@ -74,8 +74,8 @@ def verify(options): return None def generate(options): - render(curlrc_config, 'system/curlrc.tmpl', options) - render(ssh_config, 'system/ssh_config.tmpl', options) + render(curlrc_config, 'system/curlrc.j2', options) + render(ssh_config, 'system/ssh_config.j2', options) return None def apply(options): diff --git a/src/conf_mode/system_sysctl.py b/src/conf_mode/system_sysctl.py index 4f16d1ed6..2e0004ffa 100755 --- a/src/conf_mode/system_sysctl.py +++ b/src/conf_mode/system_sysctl.py @@ -50,7 +50,7 @@ def generate(sysctl): os.unlink(config_file) return None - render(config_file, 'system/sysctl.conf.tmpl', sysctl) + render(config_file, 'system/sysctl.conf.j2', sysctl) return None def apply(sysctl): -- cgit v1.2.3