saltstack : Jinja error: argument of type 'NoneType' is not iterable
local: Data failed to compile:---------- Rendering SLS 'base:vhost' failed: Jinja error: 'NoneType' object is not iterableTraceback (most recent call last): File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 389, in render_jinja_tmpl output = template.render(**decoded_context) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File " ", line 8, in top-level template codeTypeError: 'NoneType' object is not iterable; line 8---[...]{% for dir ,items in salt['pillar.get']("nginx:dir").items() %}/data/app/{ { dir }}: file.directory: - makedirs: True{% if 'options' in items and 'options' is defined %}{% for value in items.options|default([]) %} <======================{ {value}}: file.directory: - makedirs: True{% endfor %}{% endif %}[...]---
pillar 变量如下:
nginx: dir: cps: options: - /data/001 - /data/002 relad:
处理方法:
relad: {}