Do not throw an exception when an invalid requisite is set #35226
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
P4
Priority 4
severity-low
4th level, cosemtic problems, work around exists
Milestone
Description of Issue/Question
When an invalid require tag is set, there are no safety check in the code and an exception will be raised instead of showing a nice explanation of what is going on. It makes it really difficult to diagnose what's wrong with the SLS file.
Setup
Example SLS :
The following exception will be raised :
The line 1868 in /usr/lib/python2.6/site-packages/salt/state.py tries to compare two strings. In this case, a dictionary will be passed instead of a string. When the fnmatch method will try to match the values, it will access
req_val[0]
, which is not a valid key for the dictionary.Steps to Reproduce Issue
Write an invalid SLS with a require on a dictionary.
Versions Report
Salt Version:
Salt: 2016.3.2
Dependency Versions:
cffi: Not Installed
cherrypy: 3.2.2
dateutil: 1.4.1
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.2.1
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.20.2
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51)
python-gnupg: Not Installed
PyYAML: 3.10
PyZMQ: 14.5.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist: redhat 6.7 Santiago
machine: x86_64
release: 2.6.32-573.22.1.el6.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 6.7 Santiago
The text was updated successfully, but these errors were encountered: