Merge branch '2016.11' into 'develop'

Conflicts:
  - salt/modules/status.py
This commit is contained in:
rallytime 2016-11-01 12:56:04 -06:00
commit e57fb947c6
34 changed files with 32030 additions and 6447 deletions

View file

@ -28,7 +28,7 @@
# dictionary. Otherwise it is assumed that the module calls the grains
# function in a custom way and returns the data elsewhere
#
# Default to False for 2016.3 and Carbon. Switch to True for Nitrogen.
# Default to False for 2016.3 and 2016.11. Switch to True for Nitrogen.
# proxy_merge_grains_in_module: False
# If multiple masters are specified in the 'master' setting, the default behavior

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-API" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-API" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-api \- salt-api Command
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CALL" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-CALL" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-call \- salt-call Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CLOUD" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-CLOUD" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-cloud \- Salt Cloud Command
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CP" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-CP" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-cp \- salt-cp Documentation
.
@ -52,6 +52,9 @@ salt\-cp \-G \(aqos:Arch.*\(aq [ options ] SOURCE DEST
Salt copy copies a local file out to all of the Salt minions matched by the
given target.
.sp
Salt copy is only intended for use with small files (< 100KB). If you need
to copy large files out to minions please use the cp.get_file function.
.sp
Note: salt\-cp uses salt\(aqs publishing mechanism. This means the privacy of the
contents of the file on the wire is completely dependent upon the transport
in use. In addition, if the salt\-master is running with debug logging it is

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-KEY" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-KEY" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-key \- salt-key Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-MASTER" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-MASTER" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-master \- salt-master Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-MINION" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-MINION" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-minion \- salt-minion Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-PROXY" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-PROXY" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-proxy \- salt-proxy Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-RUN" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-RUN" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-run \- salt-run Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-SSH" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-SSH" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-ssh \- salt-ssh Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-SYNDIC" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-SYNDIC" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-syndic \- salt-syndic Documentation
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-UNITY" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT-UNITY" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt-unity \- salt-unity Command
.

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SALT" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
salt \- salt
.

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SPM" "1" "October 26, 2016" "2016.3.4" "Salt"
.TH "SPM" "1" "October 31, 2016" "2016.11.0" "Salt"
.SH NAME
spm \- Salt Package Manager Command
.

View file

@ -415,6 +415,16 @@ Multiple security groups can also be specified in the same fashion:
- default
- extra
EC2 instances can be added to an `AWS Placement Group`_ by specifying the
``placementgroup`` option:
.. code-block:: yaml
my-ec2-config:
placementgroup: my-aws-placement-group
.. _`AWS Placement Group`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
Your instances may optionally make use of EC2 Spot Instances. The
following example will request that spot instances be used and your
maximum bid will be $0.10. Keep in mind that different spot prices

View file

@ -1,13 +1,14 @@
:orphan:
====================================
Salt Release Notes - Codename Carbon
====================================
==============================================
Salt 2016.11.0 Release Notes - Codename Carbon
==============================================
Release Candidate
=================
See :ref:`Installing/Testing a Salt Release Candidate <release-candidate>` for instructions to install the latest release candidate.
See :ref:`Installing/Testing a Salt Release Candidate <release-candidate>` for instructions to install the
latest release candidate.
Release Candidate Known Issues
------------------------------
@ -25,7 +26,7 @@ New Features
Docker Introspection and Configuration
--------------------------------------
Major additions have been made to the Docker support in Carbon. The new
Major additions have been made to the Docker support in 2016.11.0. The new
addition allows Salt to be executed within a Docker container without a
minion running or installed in the container. This allows states to
be run inside a container, but also all of Salt's remote execution
@ -151,7 +152,7 @@ Grains Changes
is the `official capitalization <https://www.vmware.com>`_. Additionally,
all references to ``VMWare`` in the documentation have been changed to
``VMware`` :issue:`30807`. Environments using versions of Salt before and
after Salt Carbon should employ case-insensitive grain matching on these
after Salt 2016.11.0 should employ case-insensitive grain matching on these
grains.
.. code-block:: jinja
@ -374,7 +375,7 @@ General Deprecations
- ``env`` to ``saltenv``
All occurrences of ``env`` and some occurrences of ``__env__`` marked for
deprecation in Salt Carbon have been removed. The new way to use the salt
deprecation in Salt 2016.11.0 have been removed. The new way to use the salt
environment setting is with a variable called ``saltenv``:
.. code-block:: python

View file

@ -16,13 +16,11 @@ Latest Branch Release
Previous Releases
=================
.. after carbon releases, remove carbon from the list below:
.. releasestree::
:maxdepth: 1
:glob:
carbon
2016.11.*
2016.3.*
2015.8.*
2015.5.*

View file

@ -28,8 +28,9 @@ Assigned codenames:
- Lithium: ``2015.5.0``
- Beryllium: ``2015.8.0``
- Boron: ``2016.3.0``
- Carbon: ``TBD``
- Carbon: ``2016.11.0``
- Nitrogen: ``TBD``
- Oxygen: ``TBD``
Example
-------

View file

@ -2,7 +2,7 @@
'''
Cache data in filesystem.
.. versionadded:: carbon
.. versionadded:: 2016.11.0
Expirations can be set in the relevant config file (``/etc/salt/master`` for
the master, ``/etc/salt/cloud`` for Salt Cloud, etc).

View file

@ -2,7 +2,7 @@
'''
Connection module for Amazon CloudWatch Events
.. versionadded:: carbon
.. versionadded:: 2016.11.0
:configuration: This module accepts explicit credentials but can also utilize
IAM roles assigned to the instance through Instance Profiles. Dynamic

View file

@ -668,7 +668,7 @@ def get_all_instance_profiles(path_prefix='/', region=None, key=None,
'''
Get and return all IAM instance profiles, starting at the optional path.
.. versionadded:: carbon
.. versionadded:: 2016.11.0
CLI Example:
@ -692,7 +692,7 @@ def list_instance_profiles(path_prefix='/', region=None, key=None,
'''
List all IAM instance profiles, starting at the optional path.
.. versionadded:: carbon
.. versionadded:: 2016.11.0
CLI Example:

View file

@ -113,7 +113,7 @@ def install_app(app, target='/Applications/'):
if not app[-1] == '/':
app += '/'
cmd = 'rsync -a --no-compress --delete {0} {1}'.format(app, target)
cmd = 'rsync -a --delete {0} {1}'.format(app, target)
return __salt__['cmd.run'](cmd)

View file

@ -4,7 +4,9 @@ Module for editing power settings on Mac OS X
.. versionadded:: 2016.3.0
'''
# Import python libs
from __future__ import absolute_import
import time
# Import salt libs
import salt.utils
@ -238,7 +240,12 @@ def set_harddisk_sleep(minutes):
value = _validate_sleep(minutes)
cmd = 'systemsetup -setharddisksleep {0}'.format(value)
salt.utils.mac_utils.execute_return_success(cmd)
return str(value) in get_harddisk_sleep()
# Give macOS some time to change the setting
for i in range(5):
if str(value) in get_harddisk_sleep():
return True
time.sleep(1)
def get_wake_on_modem():

View file

@ -139,8 +139,9 @@ def uptime():
The uptime function was changed to return a dictionary of easy-to-read
key/value pairs containing uptime information, instead of the output
from a ``cmd.run`` call.
.. versionchanged:: carbon
Support for OpenBSD, FreeBSD, NetBSD, MacOS, and Solaris
.. versionchanged:: 2016.11.0
Fall back to output of `uptime` when /proc/uptime is not available.
CLI Example:

View file

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
'''
Manage CloudTrail Objects
=================
=========================
.. versionadded:: carbon
.. versionadded:: 2016.11.0
Create and destroy CloudWatch event rules. Be aware that this interacts with Amazon's services,
and so may incur charges.

View file

@ -1553,7 +1553,7 @@ def running(name,
This option requires Docker 1.9.0 or newer and
docker-py 1.7.0 or newer.
.. versionadded:: carbon
.. versionadded:: 2016.11.0
'''
ret = {'name': name,
'changes': {},

View file

@ -174,6 +174,7 @@ class NamespacedDictWrapper(collections.MutableMapping, dict):
if override_name:
self.__class__.__module__ = 'salt'
self.__class__.__name__ = override_name
super(NamespacedDictWrapper, self).__init__(self._dict())
def _dict(self):
r = self.__dict

View file

@ -392,19 +392,12 @@ class ProcessManager(object):
try:
# in case someone died while we were waiting...
self.check_children()
if not salt.utils.is_windows() and not async:
pid, exit_status = os.wait()
if pid not in self._process_map:
log.debug('Process of pid {0} died, not a known'
' process, will not restart'.format(pid))
continue
if self._restart_processes is True:
self.restart_process(pid)
elif async is True:
# The event-based subprocesses management code was removed from here
# because os.wait() conflicts with the subprocesses management logic
# implemented in `multiprocessing` package. See #35480 for details.
if async:
yield gen.sleep(10)
elif async is False:
# os.wait() is not supported on Windows.
else:
time.sleep(10)
# OSError is raised if a signal handler is called (SIGTERM) during os.wait
except OSError:

View file

@ -86,11 +86,11 @@ class SaltStackVersion(object):
'Lithium' : (2015, 5),
'Beryllium' : (2015, 8),
'Boron' : (2016, 3),
'Carbon' : (MAX_SIZE - 103, 0),
'Carbon' : (2016, 11),
'Nitrogen' : (MAX_SIZE - 102, 0),
'Oxygen' : (MAX_SIZE - 101, 0),
'Fluorine' : (MAX_SIZE - 100, 0),
# pylint: disable=E8265
#'Fluorine' : (MAX_SIZE - 100, 0),
#'Neon' : (MAX_SIZE - 99 , 0),
#'Sodium' : (MAX_SIZE - 98 , 0),
#'Magnesium' : (MAX_SIZE - 97 , 0),

View file

@ -5,6 +5,7 @@
'''
# Import python libs
from __future__ import absolute_import
import json
import tornado.stack_context
import tornado.gen
from tornado.testing import AsyncTestCase, gen_test
@ -185,3 +186,13 @@ class NamespacedDictWrapperTests(TestCase):
self._dict['prefix'] = {'foo': {'bar': 'baz'}}
w = NamespacedDictWrapper(self._dict, ('prefix', 'foo'))
self.assertEqual(w['bar'], 'baz')
def test_json_dumps_single_key(self):
self._dict['prefix'] = {'foo': {'bar': 'baz'}}
w = NamespacedDictWrapper(self._dict, 'prefix')
self.assertEqual(json.dumps(w), '{"foo": {"bar": "baz"}}')
def test_json_dumps_multiple_key(self):
self._dict['prefix'] = {'foo': {'bar': 'baz'}}
w = NamespacedDictWrapper(self._dict, ('prefix', 'foo'))
self.assertEqual(json.dumps(w), '{"bar": "baz"}')

View file

@ -57,7 +57,7 @@ class MacPackageTestCase(TestCase):
mock = MagicMock()
with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
macpackage.install_app('/path/to/file.app')
mock.assert_called_once_with('rsync -a --no-compress --delete /path/to/file.app/ '
mock.assert_called_once_with('rsync -a --delete /path/to/file.app/ '
'/Applications/file.app')
def test_install_app_specify_target(self):
@ -67,7 +67,7 @@ class MacPackageTestCase(TestCase):
mock = MagicMock()
with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
macpackage.install_app('/path/to/file.app', '/Applications/new.app')
mock.assert_called_once_with('rsync -a --no-compress --delete /path/to/file.app/ '
mock.assert_called_once_with('rsync -a --delete /path/to/file.app/ '
'/Applications/new.app')
def test_install_app_with_slash(self):
@ -77,7 +77,7 @@ class MacPackageTestCase(TestCase):
mock = MagicMock()
with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
macpackage.install_app('/path/to/file.app/')
mock.assert_called_once_with('rsync -a --no-compress --delete /path/to/file.app/ '
mock.assert_called_once_with('rsync -a --delete /path/to/file.app/ '
'/Applications/file.app')
def test_uninstall(self):

View file

@ -46,7 +46,7 @@ class TestProcessManager(TestCase):
time.sleep(0.5)
# Are there child processes still running?
if process_manager._process_map.keys():
process_manager.send_signal_to_processes(signal.SIGILL)
process_manager.send_signal_to_processes(signal.SIGKILL)
process_manager.stop_restarting()
process_manager.kill_children()
@ -72,7 +72,7 @@ class TestProcessManager(TestCase):
time.sleep(0.5)
# Are there child processes still running?
if process_manager._process_map.keys():
process_manager.send_signal_to_processes(signal.SIGILL)
process_manager.send_signal_to_processes(signal.SIGKILL)
process_manager.stop_restarting()
process_manager.kill_children()
@ -96,7 +96,7 @@ class TestProcessManager(TestCase):
time.sleep(0.5)
# Are there child processes still running?
if process_manager._process_map.keys():
process_manager.send_signal_to_processes(signal.SIGILL)
process_manager.send_signal_to_processes(signal.SIGKILL)
process_manager.stop_restarting()
process_manager.kill_children()
@ -121,7 +121,7 @@ class TestProcessManager(TestCase):
time.sleep(0.5)
# Are there child processes still running?
if process_manager._process_map.keys():
process_manager.send_signal_to_processes(signal.SIGILL)
process_manager.send_signal_to_processes(signal.SIGKILL)
process_manager.stop_restarting()
process_manager.kill_children()