mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2017.7' into merge-2017.7
Conflicts: salt/modules/pillar.py salt/states/pip_state.py salt/utils/data.py tests/unit/modules/inspectlib/test_fsdb.py tests/unit/output/test_json_out.py tests/unit/test_test_module_names.py
This commit is contained in:
commit
a04177518f
7 changed files with 37 additions and 7 deletions
|
@ -235,3 +235,17 @@ Defined in: State
|
|||
__sdb__
|
||||
-------
|
||||
Defined in: SDB
|
||||
|
||||
|
||||
Additional Globals
|
||||
==================
|
||||
|
||||
Defined for: Runners, Execution Modules, Wheels
|
||||
|
||||
* ``__jid__``: The job ID
|
||||
* ``__user__``: The user
|
||||
* ``__tag__``: The jid tag
|
||||
* ``__jid_event__``: A :py:class:`salt.utils.event.NamespacedEvent`.
|
||||
|
||||
:py:class:`NamespacedEvent <salt.utils.event.NamespacedEvent>` defines a single
|
||||
method :py:meth:`fire_event <salt.utils.event.NamespacedEvent.fire_event>`, that takes data and tag. The :ref:`Runner docs <runners>` has examples.
|
||||
|
|
|
@ -329,7 +329,7 @@ class SyncClientMixin(object):
|
|||
print_func=print_func
|
||||
)
|
||||
|
||||
# TODO: document these, and test that they exist
|
||||
# TODO: test that they exist
|
||||
# TODO: Other things to inject??
|
||||
func_globals = {'__jid__': jid,
|
||||
'__user__': data['user'],
|
||||
|
|
|
@ -10,7 +10,6 @@ import collections
|
|||
# Import third party libs
|
||||
import copy
|
||||
import os
|
||||
import copy
|
||||
import logging
|
||||
from salt.ext import six
|
||||
|
||||
|
@ -157,7 +156,7 @@ def get(key,
|
|||
'skipped.', default, ret, type(ret).__name__
|
||||
)
|
||||
elif isinstance(default, list):
|
||||
ret = salt.utils.data.traverse_dict_and_list(
|
||||
ret = salt.utils.traverse_dict_and_list( # pylint: disable=redefined-variable-type
|
||||
pillar_dict,
|
||||
key,
|
||||
[],
|
||||
|
@ -345,7 +344,7 @@ def ls(*args):
|
|||
salt '*' pillar.ls
|
||||
'''
|
||||
|
||||
return list(items(*args).keys())
|
||||
return list(items(*args))
|
||||
|
||||
|
||||
def item(*args, **kwargs):
|
||||
|
@ -544,7 +543,7 @@ def keys(key, delimiter=DEFAULT_TARGET_DELIM):
|
|||
if not isinstance(ret, dict):
|
||||
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):
|
||||
|
|
|
@ -739,7 +739,7 @@ def set_lcm_config(config_mode=None,
|
|||
cmd += ' RefreshFrequencyMins = {0};'.format(refresh_freq)
|
||||
if reboot_if_needed is not None:
|
||||
if not isinstance(reboot_if_needed, bool):
|
||||
SaltInvocationError('reboot_if_needed must be a boolean value')
|
||||
raise SaltInvocationError('reboot_if_needed must be a boolean value')
|
||||
if reboot_if_needed:
|
||||
reboot_if_needed = '$true'
|
||||
else:
|
||||
|
|
|
@ -39,6 +39,11 @@ try:
|
|||
except ImportError:
|
||||
from collections import Mapping
|
||||
|
||||
try:
|
||||
from collections.abc import Mapping
|
||||
except ImportError:
|
||||
from collections import Mapping
|
||||
|
||||
|
||||
class NestDisplay(object):
|
||||
'''
|
||||
|
|
|
@ -6,31 +6,40 @@ and data structures.
|
|||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Import Python libs
|
||||
import copy
|
||||
import fnmatch
|
||||
import logging
|
||||
import re
|
||||
|
||||
=======
|
||||
>>>>>>> 2017.7
|
||||
try:
|
||||
from collections.abc import Mapping, MutableMapping, Sequence
|
||||
except ImportError:
|
||||
from collections import Mapping, MutableMapping, Sequence
|
||||
|
||||
# Import Salt libs
|
||||
<<<<<<< HEAD
|
||||
import salt.utils.dictupdate
|
||||
import salt.utils.stringutils
|
||||
import salt.utils.yaml
|
||||
from salt.defaults import DEFAULT_TARGET_DELIM
|
||||
from salt.exceptions import SaltException
|
||||
from salt.utils.decorators.jinja import jinja_filter
|
||||
=======
|
||||
>>>>>>> 2017.7
|
||||
from salt.utils.odict import OrderedDict
|
||||
|
||||
# Import 3rd-party libs
|
||||
from salt.ext import six
|
||||
<<<<<<< HEAD
|
||||
from salt.ext.six.moves import range # pylint: disable=redefined-builtin
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
=======
|
||||
>>>>>>> 2017.7
|
||||
|
||||
|
||||
class CaseInsensitiveDict(MutableMapping):
|
||||
|
@ -112,6 +121,7 @@ def to_lowercase(data, preserve_dict_class=False):
|
|||
|
||||
def to_uppercase(data, preserve_dict_class=False):
|
||||
return __change_case(data, 'upper', preserve_dict_class)
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
@jinja_filter('compare_dicts')
|
||||
|
@ -968,3 +978,5 @@ def stringify(data):
|
|||
item = six.text_type(item)
|
||||
ret.append(item)
|
||||
return ret
|
||||
=======
|
||||
>>>>>>> 2017.7
|
||||
|
|
|
@ -110,7 +110,7 @@ class GemModuleTest(ModuleCase):
|
|||
gem.sources_add
|
||||
gem.sources_remove
|
||||
'''
|
||||
source = 'http://gems.github.com'
|
||||
source = 'http://gemcutter.org/'
|
||||
|
||||
self.run_function('gem.sources_add', [source])
|
||||
sources_list = self.run_function('gem.sources_list')
|
||||
|
|
Loading…
Add table
Reference in a new issue