mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix #1185
This commit is contained in:
parent
31dc5bbac9
commit
2dadc6a251
@ -1324,6 +1324,15 @@ class BaseHighState(object):
|
|||||||
ext[name]['__sls__'] = sls
|
ext[name]['__sls__'] = sls
|
||||||
if '__env__' not in ext[name]:
|
if '__env__' not in ext[name]:
|
||||||
ext[name]['__env__'] = env
|
ext[name]['__env__'] = env
|
||||||
|
for key in ext[name]:
|
||||||
|
if key.startswith('_'):
|
||||||
|
continue
|
||||||
|
if not isinstance(ext[name][key], list):
|
||||||
|
continue
|
||||||
|
if '.' in key:
|
||||||
|
comps = key.split('.')
|
||||||
|
ext[name][comps[0]] = ext[name].pop(key)
|
||||||
|
ext[name][comps[0]].append(comps[1])
|
||||||
if '__extend__' not in state:
|
if '__extend__' not in state:
|
||||||
state['__extend__'] = [ext]
|
state['__extend__'] = [ext]
|
||||||
else:
|
else:
|
||||||
@ -1331,27 +1340,7 @@ 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]:
|
continue
|
||||||
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
|
|
||||||
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