From ba1eeea8e2918937787ac92619cc50789843c2d7 Mon Sep 17 00:00:00 2001 From: Mark Meijerman Date: Wed, 17 Oct 2018 09:56:24 +0200 Subject: [PATCH] use items instead of iteritems to make the role compatible with python 3 --- README.md | 2 +- templates/nginx.conf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a067d29..05470c6 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Again, no need to copy the entire dictionary. Note that headers added to the `http` context will be ignored when you add headers in a `server` or `location` context. So don't forget to combine all headers: - {% for key, value in (nginx_http_headers_default | combine(nginx_http_headers) | combine(specialized_headers)).iteritems() %} + {% for key, value in (nginx_http_headers_default | combine(nginx_http_headers) | combine(specialized_headers)).items() %} add_header {{ key }} "{{ value }}" always; {% endfor %} diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index d37616d..d20b70b 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -18,7 +18,7 @@ http { access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log warn; -{% for key, value in (nginx_http_params_default | combine(nginx_http_params)).iteritems() %} +{% for key, value in (nginx_http_params_default | combine(nginx_http_params)).items() %} {% if value is sameas True %} {{ key }} on; {% elif value is sameas False %} @@ -28,7 +28,7 @@ http { {% endif %} {% endfor %} -{% for key, value in (nginx_http_headers_default | combine(nginx_http_headers)).iteritems() %} +{% for key, value in (nginx_http_headers_default | combine(nginx_http_headers)).items() %} add_header {{ key }} "{{ value }}" always; {% endfor %}