Merge pull request #9221 from basepi/prereqerror8235

Error out if prereq is not formed as a list, Fix #8235
This commit is contained in:
Thomas S Hatch 2013-12-12 14:22:13 -08:00
commit 04222e0265

View File

@ -318,11 +318,12 @@ class Compiler(object):
# Add the requires to the reqs dict and check them
# all for recursive requisites.
argfirst = next(iter(arg))
if argfirst == 'require' or argfirst == 'watch':
if argfirst in ('require', 'watch', 'prereq'):
if not isinstance(arg[argfirst], list):
errors.append(('The require or watch'
' statement in state "{0}" in sls "{1}" '
errors.append(('The {0}'
' statement in state "{1}" in sls "{2}" '
'needs to be formed as a list').format(
argfirst,
name,
body['__sls__']
))
@ -795,11 +796,12 @@ class State(object):
'a list').format(
name,
body['__sls__']))
if argfirst == 'require' or argfirst == 'watch':
if argfirst in ('require', 'watch', 'prereq'):
if not isinstance(arg[argfirst], list):
errors.append(('The require or watch'
' statement in state "{0}" in sls "{1}" '
errors.append(('The {0}'
' statement in state "{1}" in sls "{2}" '
'needs to be formed as a list').format(
argfirst,
name,
body['__sls__']
))