mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add check for '.' in require/watch requisites
This commit will cause require/watch requisites to fail if they contain dots. The prior behavior just ignored the dot, but since the function name is ignored, and dots are already illegal in prereq requisites, this commit makes the behavior more consistent.
This commit is contained in:
parent
3970c1ba77
commit
bd9302ccfe
@ -341,6 +341,19 @@ class Compiler(object):
|
||||
continue
|
||||
req_key = next(iter(req))
|
||||
req_val = req[req_key]
|
||||
if '.' in req_key:
|
||||
errors.append((
|
||||
'Invalid requisite type {0!r} '
|
||||
'in state {1!r}, in SLS '
|
||||
'{2!r}. Requisite types must '
|
||||
'not contain periods, did you '
|
||||
'mean {3!r}?'.format(
|
||||
req_key,
|
||||
name,
|
||||
body['__sls__'],
|
||||
req_key[:req_key.find('.')]
|
||||
)
|
||||
))
|
||||
if not ishashable(req_val):
|
||||
errors.append((
|
||||
'Illegal requisite "{0}", '
|
||||
@ -805,6 +818,19 @@ class State(object):
|
||||
continue
|
||||
req_key = next(iter(req))
|
||||
req_val = req[req_key]
|
||||
if '.' in req_key:
|
||||
errors.append((
|
||||
'Invalid requisite type {0!r} '
|
||||
'in state {1!r}, in SLS '
|
||||
'{2!r}. Requisite types must '
|
||||
'not contain periods, did you '
|
||||
'mean {3!r}?'.format(
|
||||
req_key,
|
||||
name,
|
||||
body['__sls__'],
|
||||
req_key[:req_key.find('.')]
|
||||
)
|
||||
))
|
||||
if not ishashable(req_val):
|
||||
errors.append((
|
||||
'Illegal requisite "{0}", '
|
||||
|
Loading…
Reference in New Issue
Block a user