"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "salt/modules/pillar.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

pillar.py  (salt-2019.2.0):pillar.py  (salt-2019.2.1)
skipping to change at line 13 skipping to change at line 13
Extract the pillar data for this minion Extract the pillar data for this minion
''' '''
from __future__ import absolute_import, print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
# Import python libs # Import python libs
import collections import collections
# Import third party libs # Import third party libs
import copy import copy
import os import os
import copy
import logging import logging
from salt.ext import six from salt.ext import six
# Import salt libs # Import salt libs
import salt.pillar import salt.pillar
import salt.utils.crypt import salt.utils.crypt
import salt.utils.data import salt.utils.data
import salt.utils.dictupdate import salt.utils.dictupdate
import salt.utils.functools import salt.utils.functools
import salt.utils.odict import salt.utils.odict
skipping to change at line 159 skipping to change at line 158
default, default,
ret, ret,
merge_lists=opt_merge_lists) merge_lists=opt_merge_lists)
else: else:
log.error( log.error(
'pillar.get: Default (%s) is a dict, but the returned ' 'pillar.get: Default (%s) is a dict, but the returned '
'pillar value (%s) is of type \'%s\'. Merge will be ' 'pillar value (%s) is of type \'%s\'. Merge will be '
'skipped.', default, ret, type(ret).__name__ 'skipped.', default, ret, type(ret).__name__
) )
elif isinstance(default, list): elif isinstance(default, list):
ret = salt.utils.data.traverse_dict_and_list( ret = salt.utils.data.traverse_dict_and_list( # pylint: disable=red efined-variable-type
pillar_dict, pillar_dict,
key, key,
[], [],
delimiter) delimiter)
if isinstance(ret, list): if isinstance(ret, list):
default = copy.deepcopy(default) default = copy.deepcopy(default)
default.extend([x for x in ret if x not in default]) default.extend([x for x in ret if x not in default])
return default return default
else: else:
log.error( log.error(
skipping to change at line 342 skipping to change at line 341
Calls the master for a fresh pillar, generates the pillar data on the Calls the master for a fresh pillar, generates the pillar data on the
fly (same as :py:func:`items`), but only shows the available main keys. fly (same as :py:func:`items`), but only shows the available main keys.
CLI Examples: CLI Examples:
.. code-block:: bash .. code-block:: bash
salt '*' pillar.ls salt '*' pillar.ls
''' '''
return list(items(*args).keys()) return list(items(*args))
def item(*args, **kwargs): def item(*args, **kwargs):
''' '''
.. versionadded:: 0.16.2 .. versionadded:: 0.16.2
Return one or more pillar entries from the :ref:`in-memory pillar data Return one or more pillar entries from the :ref:`in-memory pillar data
<pillar-in-memory>`. <pillar-in-memory>`.
delimiter delimiter
Delimiter used to traverse nested dictionaries. Delimiter used to traverse nested dictionaries.
skipping to change at line 536 skipping to change at line 535
''' '''
ret = salt.utils.data.traverse_dict_and_list( ret = salt.utils.data.traverse_dict_and_list(
__pillar__, key, KeyError, delimiter) __pillar__, key, KeyError, delimiter)
if ret is KeyError: if ret is KeyError:
raise KeyError("Pillar key not found: {0}".format(key)) raise KeyError("Pillar key not found: {0}".format(key))
if not isinstance(ret, dict): if not isinstance(ret, dict):
raise ValueError("Pillar value in key {0} is not a dict".format(key)) raise ValueError("Pillar value in key {0} is not a dict".format(key))
return ret.keys() return list(ret)
def file_exists(path, saltenv=None): def file_exists(path, saltenv=None):
''' '''
.. versionadded:: 2016.3.0 .. versionadded:: 2016.3.0
This is a master-only function. Calling from the minion is not supported. This is a master-only function. Calling from the minion is not supported.
Use the given path and search relative to the pillar environments to see if Use the given path and search relative to the pillar environments to see if
a file exists at that path. a file exists at that path.
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)