grains.has_key() always returns false in 2016.3.0 #33614
Labels
Bug
broken, incorrect, or confusing behavior
Core
relates to code central or existential to Salt
fixed-pls-verify
fix is linked, bug author to confirm fix
severity-critical
top severity, seen by most users, serious issues
ZRELEASED - Boron
Milestone
Description of Issue/Question
grains.has_key() always returns false in 2016.3.0
Setup
Our config has used constructs like {% if grains.has_key('os_family') and grains['os_family'] == 'Debian' %} for grains which are not present on all architectures. On 2016.3.0, this stopped working, but "grains.os_family is defined" still works.
Example SLS snippet for testing:
The resulting file (with empty lines removed) is:
Steps to Reproduce Issue
Just run state.highstate with the SLS snipet above and look in /tmp/graintest.
Versions Report
skrotnisse:~# salt-call --versions-report
Salt Version:
Salt: 2016.3.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.5
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.6
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.21.1
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.3 (default, Mar 14 2014, 11:57:14)
python-gnupg: Not Installed
PyYAML: 3.10
PyZMQ: 13.1.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 3.2.3
System Versions:
dist: debian 7.10
machine: i686
release: 3.2.0-4-686-pae
system: Linux
version: debian 7.10
My salt master is currently running 2015.5.3, but I do not think that is relevant in this case, since the jinja is rendered on the client side as far as I can tell.
The text was updated successfully, but these errors were encountered: