You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Salt Version:
Salt: 2019.2.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
docker-py: Not Installed
gitdb: 2.0.0
gitpython: 2.1.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.13 (default, Nov 24 2017, 17:33:09)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.1
timelib: Not Installed
Tornado: 4.4.3
ZMQ: 4.2.1
System Versions:
dist: debian 9.5
locale: UTF-8
machine: x86_64
release: 4.9.0-7-amd64
system: Linux
version: debian 9.5
Bug details
Describe the bug
Function: file.managed
Name: /etc/nginx/sites-available/francearchives
Result: False
Comment: Unable to manage file: Jinja error: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 394, in render_jinja_tmpl
output = template.render(**decoded_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 29, in top-level template code
File "<template>", line 10, in template
TypeError: object of type 'NoneType' has no len()
; line 10
---
[...]
{{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}{{ lb }}
{%- elif value is mapping -%}
{%- for k, v in value.items() -%}
{%- if v is number or v is string -%}
{{ server_config([v], k, ind) }}
{%- elif v|length() > 0 and (v[0] is number or v[0] is string) -%} <======================
{{ server_config(v, k, ind) }}
{%- else -%}
{{ lb }}{{ k|indent(ind, True) }} {{ '{' }}
{{ server_config(v, '', ind + ind_increment) -}}
{{ '}'|indent(ind, True) }}{{ lb }}
[...]
---
The text was updated successfully, but these errors were encountered:
the null is produced by a for loop that ends up empty in certain conditions. I've fixed my pillar mine code, but it might be interresting to render the jinja in nginx/files/default/server.conf more robust ?
the null is produced by a for loop that ends up empty in certain conditions. I've fixed my pillar mine code, but it might be interresting to render the jinja in nginx/files/default/server.conf more robust ?
Your setup
Formula commit hash / release tag
e8ed39a
Versions reports (master & minion)
Bug details
Describe the bug
The text was updated successfully, but these errors were encountered: