Improve Compatibility with Python3

replace .iteritems() with .items | list in jinja2 Templates
This commit is contained in:
Alexander Grothe 2019-02-24 17:50:32 +01:00
parent b816a03d69
commit 76ace23b5e
4 changed files with 5 additions and 5 deletions

View File

@ -1482,7 +1482,7 @@ description of the config file format.
:END:
#+BEGIN_SRC conf :tangle roles/nfs-server/templates/nfs-exports.j2 :mkdirp yes :padline no
/srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
{% for name, path in media_dirs.iteritems() %}
{% for name, path in media_dirs.items() | list %}
{{ path }} *(rw,fsid={{ loop.index }},sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }}{{ ',insecure' if nfs.insecure else '' }})
{% endfor %}
#+END_SRC
@ -5332,7 +5332,7 @@ end
:ID: 19a7e6f8-5795-45ff-983e-9da37e7dce26
:END:
#+BEGIN_SRC yaml :tangle roles/samba-config/templates/smb.conf.j2 :mkdirp yes
{% for name, path in media_dirs.iteritems() %}
{% for name, path in media_dirs.items() | list %}
[{{ name }}]
path = {{ path }}
comment = {{ name }} on %h

View File

@ -1,4 +1,4 @@
/srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
{% for name, path in media_dirs.iteritems() %}
{% for name, path in media_dirs.items() | list %}
{{ path }} *(rw,fsid={{ loop.index }},sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }}{{ ',insecure' if nfs.insecure else '' }})
{% endfor %}

View File

@ -78,7 +78,7 @@
follow symlinks= yes
wide links= yes
{% endif %}
{% for name, path in media_dirs.iteritems() %}
{% for name, path in media_dirs.items() | list %}
[{{ name }}]
path = {{ path }}
comment = {{ name }} on %h

View File

@ -90,7 +90,7 @@ Section "Monitor"
EndSection
{% endif %}
{% for connector, data in xrandr["Screen 0:"].iteritems() %}
{% for connector, data in xrandr["Screen 0:"].items() | list %}
{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %}
Section "Monitor"
Identifier "{{ connector|replace("-","") }}"