mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Revert "Read Pillar files into OrderedDict to preserve source order"
This commit is contained in:
parent
f31cd73808
commit
e07cd2134b
@ -13,7 +13,6 @@ import logging
|
||||
import salt.log
|
||||
import salt.crypt
|
||||
from salt.exceptions import SaltReqTimeoutError
|
||||
from salt.utils.odict import OrderedDict
|
||||
import six
|
||||
|
||||
# Import third party libs
|
||||
@ -93,11 +92,7 @@ class Serial(object):
|
||||
Run the correct loads serialization format
|
||||
'''
|
||||
try:
|
||||
# msgpack >= 0.2.0 supports object_pairs_hook parameter to return an OrderedDict
|
||||
if msgpack.version >= (0, 2, 0):
|
||||
return msgpack.loads(msg, use_list=True, object_pairs_hook=OrderedDict)
|
||||
else:
|
||||
return msgpack.loads(msg, use_list=True)
|
||||
return msgpack.loads(msg, use_list=True)
|
||||
except Exception as exc:
|
||||
log.critical('Could not deserialize msgpack message: {0}'
|
||||
'This often happens when trying to read a file not in binary mode.'
|
||||
|
@ -441,7 +441,7 @@ class Pillar(object):
|
||||
Extract the sls pillar files from the matches and render them into the
|
||||
pillar
|
||||
'''
|
||||
pillar = OrderedDict()
|
||||
pillar = {}
|
||||
errors = []
|
||||
for saltenv, pstates in matches.items():
|
||||
mods = set()
|
||||
@ -578,7 +578,7 @@ class Pillar(object):
|
||||
top, terrors = self.get_top()
|
||||
if ext:
|
||||
if self.opts.get('ext_pillar_first', False):
|
||||
self.opts['pillar'] = self.ext_pillar(OrderedDict(), pillar_dirs)
|
||||
self.opts['pillar'] = self.ext_pillar({}, pillar_dirs)
|
||||
matches = self.top_matches(top)
|
||||
pillar, errors = self.render_pillar(matches)
|
||||
pillar = self.merge_sources(pillar, self.opts['pillar'])
|
||||
|
@ -9,14 +9,12 @@ from __future__ import absolute_import
|
||||
import collections
|
||||
import six
|
||||
|
||||
# Import salt libs
|
||||
from salt.utils.odict import OrderedDict
|
||||
|
||||
|
||||
def update(dest, upd):
|
||||
for key, val in six.iteritems(upd):
|
||||
if isinstance(val, collections.Mapping):
|
||||
ret = update(dest.get(key, OrderedDict()), val)
|
||||
ret = update(dest.get(key, {}), val)
|
||||
dest[key] = ret
|
||||
else:
|
||||
dest[key] = upd[key]
|
||||
|
Loading…
Reference in New Issue
Block a user