From 48fc6c243b24c9c775741f5a318185fe84c02442 2020-05-07 22:38:58 From: Branko Majic Date: 2020-05-07 22:38:58 Subject: [PATCH] MAR-149: Use the .items() method instead of .iteritems() on dicts in Jinja2 templates. --- diff --git a/roles/php_website/templates/fpm_site.conf.j2 b/roles/php_website/templates/fpm_site.conf.j2 index 566162f9d2827ed943f2a50758d50f657465d895..6b9be0f2ed94218f2ff379f77f2b13e55061bbb2 100644 --- a/roles/php_website/templates/fpm_site.conf.j2 +++ b/roles/php_website/templates/fpm_site.conf.j2 @@ -27,6 +27,6 @@ chdir = / ; to log errors in site-specific log file. catch_workers_output = yes -{% for var, val in additional_fpm_config.iteritems() %} +{% for var, val in additional_fpm_config.items() %} {{ var }} = {{ val }} {% endfor %} diff --git a/roles/wsgi_website/templates/environment.sh.j2 b/roles/wsgi_website/templates/environment.sh.j2 index f5af0acd1fa8bef138717ff8bf924ca531707e88..917e9e9d403b859376f73a1f73386bb18d7e8056 100644 --- a/roles/wsgi_website/templates/environment.sh.j2 +++ b/roles/wsgi_website/templates/environment.sh.j2 @@ -1,3 +1,3 @@ -{% for var, val in environment_variables.iteritems() %} +{% for var, val in environment_variables.items() %} export {{ var }}='{{ val }}' {% endfor %} diff --git a/roles/wsgi_website/templates/nginx_site.j2 b/roles/wsgi_website/templates/nginx_site.j2 index 27b69d22df8b9b4599eede0e67169bedbfee62b1..cd5865d0d0893023b31c51289e4a59f2ab173c31 100644 --- a/roles/wsgi_website/templates/nginx_site.j2 +++ b/roles/wsgi_website/templates/nginx_site.j2 @@ -59,7 +59,7 @@ server { proxy_set_header Host $http_host; proxy_redirect off; - {% for header, value in proxy_headers.iteritems() -%} + {% for header, value in proxy_headers.items() -%} proxy_set_header {{ header }} {{ value }}; {% endfor -%} diff --git a/roles/wsgi_website/templates/systemd_wsgi_website.service.j2 b/roles/wsgi_website/templates/systemd_wsgi_website.service.j2 index 0169468a301f35b5b58a9e572f96992302c12116..73fe8bf895e9f50fba53419239984f36300c64bd 100644 --- a/roles/wsgi_website/templates/systemd_wsgi_website.service.j2 +++ b/roles/wsgi_website/templates/systemd_wsgi_website.service.j2 @@ -9,7 +9,7 @@ Group={{ user }} WorkingDirectory={{ home }}/code ExecStart={{ home }}/virtualenv/bin/gunicorn --bind unix:/run/wsgi/{{ fqdn }}.sock {% if use_paste %}--paste {{home}}/code/{{ wsgi_application }}{% else %}{{ wsgi_application }}{% endif %} -{% for var, val in environment_variables.iteritems() %} +{% for var, val in environment_variables.items() %} Environment="{{ var }}={{ val }}" {% endfor %}