This commit is contained in:
Thomas S Hatch 2012-05-10 15:35:01 -06:00
parent 31dc5bbac9
commit 2dadc6a251

View File

@ -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