mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #9221 from basepi/prereqerror8235
Error out if prereq is not formed as a list, Fix #8235
This commit is contained in:
commit
04222e0265
@ -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__']
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user