mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add initial support for dotted decs in extend
This commit is contained in:
parent
f119d3fcbb
commit
85ef5d5082
@ -1331,7 +1331,27 @@ class BaseHighState(object):
|
|||||||
for name in state:
|
for name in state:
|
||||||
if not isinstance(state[name], dict):
|
if not isinstance(state[name], dict):
|
||||||
if name == '__extend__':
|
if name == '__extend__':
|
||||||
|
for name_ in state[name]:
|
||||||
|
if isinstance(state[name][name_], basestring):
|
||||||
|
# Is this is a short state, it needs to be
|
||||||
|
# padded
|
||||||
|
if '.' in state[name][name_]:
|
||||||
|
comps = state[name][name_].split('.')
|
||||||
|
state[name][name_] = {comps[0]: [comps[1]]}
|
||||||
continue
|
continue
|
||||||
|
errors.append(('Name {0} in sls {1} is not a dictionary'
|
||||||
|
.format(name_, sls)))
|
||||||
|
|
||||||
|
# TODO add extend support for new dotted standrd decs
|
||||||
|
for key in state[name][name_]:
|
||||||
|
if key.startswith('_'):
|
||||||
|
continue
|
||||||
|
if not isinstance(state[name][name_][key], list):
|
||||||
|
continue
|
||||||
|
if '.' in key:
|
||||||
|
comps = key.split('.')
|
||||||
|
state[name][name_][comps[0]] = state[name].pop(key)
|
||||||
|
state[name][name_][comps[0]].append(comps[1])
|
||||||
|
|
||||||
if isinstance(state[name], basestring):
|
if isinstance(state[name], basestring):
|
||||||
# Is this is a short state, it needs to be padded
|
# Is this is a short state, it needs to be padded
|
||||||
|
Loading…
Reference in New Issue
Block a user