From 1954c1a3f3a50cdb7746c9c9ca4e86bc99f72c12 Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Fri, 12 Aug 2016 15:21:15 -0600 Subject: [PATCH 01/35] Update cassandra returner for JPMC --- salt/modules/cassandra_cql.py | 216 ++++++++++++++++++++++++- salt/returners/cassandra_cql_return.py | 83 ++++++---- 2 files changed, 261 insertions(+), 38 deletions(-) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 0aa10f992d..0b64dd5573 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -31,17 +31,63 @@ Cassandra Database Module - 192.168.50.12 port: 9000 username: cas_admin + +.. versionchanged:: Carbon + Added support for ``ssl_options`` and ``protocol_version``. + + Example configuration with + `ssl options `_: + + If ``ssl_options`` are present in cassandra config the cassandra_cql returner + will use SSL. SSL isn't used if ``ssl_options`` isn't specified. + + .. code-block:: yaml + + cassandra: + cluster: + - 192.168.50.10 + - 192.168.50.11 + - 192.168.50.12 + port: 9000 + username: cas_admin + + ssl_options: + ca_certs: /etc/ssl/certs/ca-bundle.trust.crt + + # SSL version should be one from the ssl module + # This is an optional parameter + ssl_version: PROTOCOL_TLSv1 + + Additionally you can also specify the ``protocol_version`` to + `use `_. + + .. code-block:: yaml + + cassandra: + cluster: + - 192.168.50.10 + - 192.168.50.11 + - 192.168.50.12 + port: 9000 + username: cas_admin + + # defaults to 4, if not set + protocol_version: 3 + ''' # Import Python Libs from __future__ import absolute_import import logging import json +import ssl # Import Salt Libs from salt.exceptions import CommandExecutionError from salt.ext import six +SSL_VERSION = 'ssl_version' + log = logging.getLogger(__name__) __virtualname__ = 'cassandra_cql' @@ -51,8 +97,10 @@ try: # pylint: disable=import-error,no-name-in-module from cassandra.cluster import Cluster from cassandra.cluster import NoHostAvailable - from cassandra.connection import ConnectionException, ConnectionShutdown + from cassandra.connection import ConnectionException, \ + ConnectionShutdown, OperationTimedOut from cassandra.auth import PlainTextAuthProvider + from cassandra.policies import DCAwareRoundRobinPolicy, WhiteListRoundRobinPolicy from cassandra.query import dict_factory # pylint: enable=import-error,no-name-in-module HAS_DRIVER = True @@ -72,6 +120,10 @@ def __virtual__(): return (False, 'Cannot load cassandra_cql module: python driver not found') +def _async_log_errors(errors): + log.error('Cassandra_cql async call returned: {0}'.format(errors)) + + def _load_properties(property_name, config_option, set_default=False, default=None): ''' Load properties for the cassandra module from config or pillar. @@ -83,7 +135,7 @@ def _load_properties(property_name, config_option, set_default=False, default=No :param set_default: Should a default be set if not found in config. :type set_default: bool :param default: The default value to be set. - :type default: str + :type default: str or int :return: The property fetched from the configuration or default. :rtype: str or list of str ''' @@ -107,7 +159,39 @@ def _load_properties(property_name, config_option, set_default=False, default=No return property_name -def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None): +def _get_ssl_opts(): + ''' + Parse out ssl_options for Cassandra cluster connection. + Make sure that the ssl_version (if any specified) is valid. + ''' + sslopts = __salt__['config.option']('cassandra').get('ssl_options', None) + ssl_opts = {} + + if sslopts: + ssl_opts['ca_certs'] = sslopts['ca_certs'] + if SSL_VERSION in sslopts: + if not sslopts[SSL_VERSION].startswith('PROTOCOL_'): + valid_opts = ', '.join( + [x for x in dir(ssl) if x.startswith('PROTOCOL_')] + ) + raise CommandExecutionError('Invalid protocol_version ' + 'specified! ' + 'Please make sure ' + 'that the ssl protocol' + 'version is one from the SSL' + 'module. ' + 'Valid options are ' + '{0}'.format(valid_opts)) + else: + ssl_opts[SSL_VERSION] = \ + getattr(ssl, sslopts[SSL_VERSION]) + return ssl_opts + else: + return None + + +def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, + protocol_version=4): ''' Connect to a Cassandra cluster. @@ -119,6 +203,8 @@ def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None): :type cql_pass: str :param port: The Cassandra cluster port, defaults to None. :type port: int + :param protocol_version: Cassandra protocol version to use. + :type port: int :return: The session and cluster objects. :rtype: cluster object, session object ''' @@ -140,19 +226,53 @@ def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None): and 'cassandra_cql_returner_session' in __context__): return __context__['cassandra_cql_returner_cluster'], __context__['cassandra_cql_returner_session'] else: + contact_points = _load_properties(property_name=contact_points, config_option='cluster') contact_points = contact_points if isinstance(contact_points, list) else contact_points.split(',') port = _load_properties(property_name=port, config_option='port', set_default=True, default=9042) cql_user = _load_properties(property_name=cql_user, config_option='username', set_default=True, default="cassandra") cql_pass = _load_properties(property_name=cql_pass, config_option='password', set_default=True, default="cassandra") + log.debug('()()()()()()()()()()()()( proto version passed {0} ^^^'.format(protocol_version)) + protocol_version = _load_properties(property_name=None, config_option='protocol_version', + set_default=True, default=4) + log.debug('^^^^^^^^^^^^^^^^^^^^^^ proto version retrieved {0} ^^^'.format(protocol_version)) + try: auth_provider = PlainTextAuthProvider(username=cql_user, password=cql_pass) - cluster = Cluster(contact_points, port=port, auth_provider=auth_provider) - session = cluster.connect() + ssl_opts = _get_ssl_opts() + if ssl_opts: + # lbp = WhiteListRoundRobinPolicy(contact_points) + cluster = Cluster(contact_points, + port=port, +# load_balancing_policy=lbp, + auth_provider=auth_provider, + ssl_options=ssl_opts, + protocol_version=protocol_version, + compression=True) + else: +# lbp = WhiteListRoundRobinPolicy(contact_points) + cluster = Cluster(contact_points, port=port, +# load_balancing_policy=lbp, + auth_provider=auth_provider, + protocol_version=protocol_version, + compression=True) + for recontimes in [1, 2, 3]: + try: + log.warning('Attempting connect') + session = cluster.connect() + log.warning('After connect') + break + except OperationTimedOut: + log.warning('Cassandra cluster.connect timed out, try {0}'.format(recontimes)) + if recontimes >= 3: + raise + # TODO: Call cluster.shutdown() when the module is unloaded on shutdown. __context__['cassandra_cql_returner_cluster'] = cluster __context__['cassandra_cql_returner_session'] = session + __context__['cassandra_cql_prepared'] = {} + log.debug('Successfully connected to Cassandra cluster at {0}'.format(contact_points)) return cluster, session except TypeError: @@ -216,6 +336,92 @@ def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=Non return ret +def cql_query_with_prepare(query, statement_name, statement_arguments, async=False, + callback_errors=None, + contact_points=None, port=None, cql_user=None, cql_pass=None): + ''' + Run a query on a Cassandra cluster and return a dictionary. + + This function should not be used asynchronously for SELECTs -- it will not + return anything and we don't currently have a mechanism for handling a future + that will return results. + + :param query: The query to execute. + :type query: str + :param statement_name: Name to assign the prepared statement in the __context__ dictionary + :type statement_name: str + :param statement_arguments: Bind parameters for the SQL statement + :type statement_arguments: list[str] + :param async: Run this query in asynchronous mode + :type async: bool + :param callback_errors: Function to call after query runs if there is an error + :type callback_errors: Function callable + :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. + :type contact_points: str | list[str] + :param cql_user: The Cassandra user if authentication is turned on. + :type cql_user: str + :param cql_pass: The Cassandra user password if authentication is turned on. + :type cql_pass: str + :param port: The Cassandra cluster port, defaults to None. + :type port: int + :param params: The parameters for the query, optional. + :type params: str + :return: A dictionary from the return values of the query + :rtype: list[dict] + ''' + try: + cluster, session = _connect(contact_points=contact_points, port=port, + cql_user=cql_user, cql_pass=cql_pass) + except CommandExecutionError: + log.critical('Could not get Cassandra cluster session.') + raise + except BaseException as e: + log.critical('Unexpected error while getting Cassandra cluster session: {0}'.format(str(e))) + raise + + if statement_name not in __context__['cassandra_cql_prepared']: + try: + bound_statement = session.prepare(query) + __context__['cassandra_cql_prepared'][statement_name] = bound_statement + except BaseException as e: + log.critical('Unexpected error while preparing SQL statement: {0}'.format(str(e))) + raise + else: + bound_statement = __context__['cassandra_cql_prepared'][statement_name] + + session.row_factory = dict_factory + ret = [] + + try: + if async: + future_results = session.execute_async(bound_statement.bind(statement_arguments)) + # future_results.add_callbacks(_async_log_errors) + else: + results = session.execute(bound_statement.bind(statement_arguments)) + except BaseException as e: + log.error('Failed to execute query: {0}\n reason: {1}'.format(query, str(e))) + msg = "ERROR: Cassandra query failed: {0} reason: {1}".format(query, str(e)) + raise CommandExecutionError(msg) + + if not async and results: + for result in results: + values = {} + for key, value in six.iteritems(result): + # Salt won't return dictionaries with odd types like uuid.UUID + if not isinstance(value, six.text_type): + # Must support Cassandra collection types. + # Namely, Cassandras set, list, and map collections. + if not isinstance(value, (set, list, dict)): + value = str(value) + values[key] = value + ret.append(values) + + # If this was a synchronous call, then we either have a empty list + # because there was no return, or we have a return + # If this was an async call we only return the empty list + return ret + + def version(contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Show the Cassandra version. diff --git a/salt/returners/cassandra_cql_return.py b/salt/returners/cassandra_cql_return.py index d0c6be1e96..44765652c2 100644 --- a/salt/returners/cassandra_cql_return.py +++ b/salt/returners/cassandra_cql_return.py @@ -159,21 +159,24 @@ def returner(ret): ''' query = '''INSERT INTO salt.salt_returns ( jid, minion_id, fun, alter_time, full_ret, return, success - ) VALUES ( - '{0}', '{1}', '{2}', '{3}', '{4}', '{5}', {6} - );'''.format( - ret['jid'], - ret['id'], - ret['fun'], - int(time.time() * 1000), - json.dumps(ret).replace("'", "''"), - json.dumps(ret['return']).replace("'", "''"), - ret.get('success', False) - ) + ) VALUES (?, ?, ?, ?, ?, ?, ?)''' + + statement_arguments = [] + + statement_arguments.append('{0}'.format(ret['jid'])) + statement_arguments.append('{0}'.format(ret['id'])) + statement_arguments.append('{0}'.format(ret['fun'])) + statement_arguments.append(int(time.time() * 1000)) + statement_arguments.append('{0}'.format(json.dumps(ret).replace("'", "''"))) + statement_arguments.append('{0}'.format(json.dumps(ret['return']).replace("'", "''"))) + statement_arguments.append(ret.get('success', False)) # cassandra_cql.cql_query may raise a CommandExecutionError try: - __salt__['cassandra_cql.cql_query'](query) + __salt__['cassandra_cql.cql_query_with_prepare'](query, + 'returner_return', + tuple(statement_arguments), + async=True) except CommandExecutionError: log.critical('Could not insert into salt_returns with Cassandra returner.') raise @@ -185,13 +188,19 @@ def returner(ret): # The data in salt.minions will be used by get_fun and get_minions query = '''INSERT INTO salt.minions ( minion_id, last_fun - ) VALUES ( - '{0}', '{1}' - );'''.format(ret['id'], ret['fun']) + ) VALUES (?, ?)''' + + statement_arguments = [] + + statement_arguments.append('{0}'.format(ret['id'])) + statement_arguments.append('{0}'.format(ret['fun'])) # cassandra_cql.cql_query may raise a CommandExecutionError try: - __salt__['cassandra_cql.cql_query'](query) + __salt__['cassandra_cql.cql_query_with_prepare'](query, + 'returner_minion', + tuple(statement_arguments), + async=True) except CommandExecutionError: log.critical('Could not store minion ID with Cassandra returner.') raise @@ -218,16 +227,19 @@ def event_return(events): query = '''INSERT INTO salt.salt_events ( id, alter_time, data, master_id, tag ) VALUES ( - {0}, {1}, '{2}', '{3}', '{4}' - );'''.format(str(uuid.uuid1()), - int(time.time() * 1000), - json.dumps(data).replace("'", "''"), - __opts__['id'], - tag) + ?, ?, ?, ?, ?) + ''' + statement_arguments = [str(uuid.uuid1()), + int(time.time() * 1000), + json.dumps(data).replace("'", "''"), + __opts__['id'], + tag] # cassandra_cql.cql_query may raise a CommandExecutionError try: - __salt__['cassandra_cql.cql_query'](query) + __salt__['cassandra_cql.cql_query_with_prepare'](query, 'salt_events', + statement_arguments, + async=True) except CommandExecutionError: log.critical('Could not store events with Cassandra returner.') raise @@ -245,13 +257,18 @@ def save_load(jid, load, minions=None): # json.dumps(load) must be escaped Cassandra style. query = '''INSERT INTO salt.jids ( jid, load - ) VALUES ( - '{0}', '{1}' - );'''.format(jid, json.dumps(load).replace("'", "''")) + ) VALUES (?, ?)''' + + statement_arguments = [ + jid, + json.dumps(load).replace("'", "''") + ] # cassandra_cql.cql_query may raise a CommandExecutionError try: - __salt__['cassandra_cql.cql_query'](query) + __salt__['cassandra_cql.cql_query_with_prepare'](query, 'save_load', + statement_arguments, + async=True) except CommandExecutionError: log.critical('Could not save load in jids table.') raise @@ -272,13 +289,13 @@ def get_load(jid): ''' Return the load data that marks a specified jid ''' - query = '''SELECT load FROM salt.jids WHERE jid = '{0}';'''.format(jid) + query = '''SELECT load FROM salt.jids WHERE jid = ?;''' ret = {} # cassandra_cql.cql_query may raise a CommandExecutionError try: - data = __salt__['cassandra_cql.cql_query'](query) + data = __salt__['cassandra_cql.cql_query_with_prepare'](query, 'get_load', [jid]) if data: load = data[0].get('load') if load: @@ -298,13 +315,13 @@ def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' - query = '''SELECT minion_id, full_ret FROM salt.salt_returns WHERE jid = '{0}';'''.format(jid) + query = '''SELECT minion_id, full_ret FROM salt.salt_returns WHERE jid = ?;''' ret = {} # cassandra_cql.cql_query may raise a CommandExecutionError try: - data = __salt__['cassandra_cql.cql_query'](query) + data = __salt__['cassandra_cql.cql_query_with_prepare'](query, 'get_jid', [jid]) if data: for row in data: minion = row.get('minion_id') @@ -326,13 +343,13 @@ def get_fun(fun): ''' Return a dict of the last function called for all minions ''' - query = '''SELECT minion_id, last_fun FROM salt.minions where last_fun = '{0}';'''.format(fun) + query = '''SELECT minion_id, last_fun FROM salt.minions where last_fun = ?;''' ret = {} # cassandra_cql.cql_query may raise a CommandExecutionError try: - data = __salt__['cassandra_cql.cql_query'](query) + data = __salt__['cassandra_cql.cql_query'](query, 'get_fun', [fun]) if data: for row in data: minion = row.get('minion_id') From 901ab8b74cc244725dafec6ec16fa5fd96a953ea Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Tue, 16 Aug 2016 09:39:20 -0600 Subject: [PATCH 02/35] Remove unnecessary log statements --- salt/modules/cassandra_cql.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 0b64dd5573..68c3dc1575 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -232,36 +232,27 @@ def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, port = _load_properties(property_name=port, config_option='port', set_default=True, default=9042) cql_user = _load_properties(property_name=cql_user, config_option='username', set_default=True, default="cassandra") cql_pass = _load_properties(property_name=cql_pass, config_option='password', set_default=True, default="cassandra") - log.debug('()()()()()()()()()()()()( proto version passed {0} ^^^'.format(protocol_version)) protocol_version = _load_properties(property_name=None, config_option='protocol_version', set_default=True, default=4) - log.debug('^^^^^^^^^^^^^^^^^^^^^^ proto version retrieved {0} ^^^'.format(protocol_version)) - try: auth_provider = PlainTextAuthProvider(username=cql_user, password=cql_pass) ssl_opts = _get_ssl_opts() if ssl_opts: - # lbp = WhiteListRoundRobinPolicy(contact_points) cluster = Cluster(contact_points, port=port, -# load_balancing_policy=lbp, auth_provider=auth_provider, ssl_options=ssl_opts, protocol_version=protocol_version, compression=True) else: -# lbp = WhiteListRoundRobinPolicy(contact_points) cluster = Cluster(contact_points, port=port, -# load_balancing_policy=lbp, auth_provider=auth_provider, protocol_version=protocol_version, compression=True) for recontimes in [1, 2, 3]: try: - log.warning('Attempting connect') session = cluster.connect() - log.warning('After connect') break except OperationTimedOut: log.warning('Cassandra cluster.connect timed out, try {0}'.format(recontimes)) From e31555345fc1c79f064f0188e895468714300172 Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Tue, 16 Aug 2016 09:54:54 -0600 Subject: [PATCH 03/35] Add timeout documentation. --- salt/returners/cassandra_cql_return.py | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/salt/returners/cassandra_cql_return.py b/salt/returners/cassandra_cql_return.py index 44765652c2..897f2feb0c 100644 --- a/salt/returners/cassandra_cql_return.py +++ b/salt/returners/cassandra_cql_return.py @@ -88,6 +88,33 @@ To use the cassandra returner, append '--return cassandra_cql' to the salt comma .. code-block:: bash salt '*' test.ping --return_cql cassandra + +Note: if your Cassandra instance has not been tuned much you may benefit from +altering some timeouts in `cassandra.yaml` like so: + +.. code-block:: bash + # How long the coordinator should wait for read operations to complete + read_request_timeout_in_ms: 5000 + # How long the coordinator should wait for seq or index scans to complete + range_request_timeout_in_ms: 20000 + # How long the coordinator should wait for writes to complete + write_request_timeout_in_ms: 20000 + # How long the coordinator should wait for counter writes to complete + counter_write_request_timeout_in_ms: 10000 + # How long a coordinator should continue to retry a CAS operation + # that contends with other proposals for the same row + cas_contention_timeout_in_ms: 5000 + # How long the coordinator should wait for truncates to complete + # (This can be much longer, because unless auto_snapshot is disabled + # we need to flush first so we can snapshot before removing the data.) + truncate_request_timeout_in_ms: 60000 + # The default timeout for other, miscellaneous operations + request_timeout_in_ms: 20000 + +As always, your mileage may vary and your Cassandra cluster may have different +needs. SaltStack has seen situations where these timeouts can resolve +some stacktraces that appear to come from the Datastax Python driver. + ''' from __future__ import absolute_import # Let's not allow PyLint complain about string substitution From cec7f6a7ec07ffd512b7a89669e9476953358c9c Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Tue, 16 Aug 2016 12:08:47 -0600 Subject: [PATCH 04/35] remove unneeded import --- salt/modules/cassandra_cql.py | 1 - 1 file changed, 1 deletion(-) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 68c3dc1575..7cc18d197e 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -100,7 +100,6 @@ try: from cassandra.connection import ConnectionException, \ ConnectionShutdown, OperationTimedOut from cassandra.auth import PlainTextAuthProvider - from cassandra.policies import DCAwareRoundRobinPolicy, WhiteListRoundRobinPolicy from cassandra.query import dict_factory # pylint: enable=import-error,no-name-in-module HAS_DRIVER = True From 0b95b85e6945b80bf2f552048c08782fb698c3e7 Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Wed, 17 Aug 2016 16:27:52 +0100 Subject: [PATCH 05/35] Check for all success return codes in dism state Only checking for 0 returns a failure where a reboot is needed. --- salt/states/win_dism.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/salt/states/win_dism.py b/salt/states/win_dism.py index 14d35d020d..08c0a01fb8 100644 --- a/salt/states/win_dism.py +++ b/salt/states/win_dism.py @@ -83,7 +83,7 @@ def capability_installed(name, status = __salt__['dism.add_capability']( name, source, limit_access, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to install {0}: {1}'\ .format(name, status['stdout']) ret['result'] = False @@ -139,7 +139,7 @@ def capability_removed(name, image=None, restart=False): # Remove the capability status = __salt__['dism.remove_capability'](name, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to remove {0}: {1}' \ .format(name, status['stdout']) ret['result'] = False @@ -210,7 +210,7 @@ def feature_installed(name, status = __salt__['dism.add_feature']( name, package, source, limit_access, enable_parent, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to install {0}: {1}' \ .format(name, status['stdout']) ret['result'] = False @@ -270,7 +270,7 @@ def feature_removed(name, remove_payload=False, image=None, restart=False): status = __salt__['dism.remove_feature']( name, remove_payload, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to remove {0}: {1}' \ .format(name, status['stdout']) ret['result'] = False @@ -338,7 +338,7 @@ def package_installed(name, status = __salt__['dism.add_package']( name, ignore_check, prevent_pending, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to install {0}: {1}' \ .format(name, status['stdout']) ret['result'] = False @@ -407,7 +407,7 @@ def package_removed(name, image=None, restart=False): # Remove the package status = __salt__['dism.remove_package'](name, image, restart) - if status['retcode'] != 0: + if status['retcode'] not in [0, 1641, 3010]: ret['comment'] = 'Failed to remove {0}: {1}' \ .format(name, status['stdout']) ret['result'] = False From d036299f6f73aafebe8a3af35af3e1c5b1566dab Mon Sep 17 00:00:00 2001 From: Dmitry Kuzmenko Date: Thu, 18 Aug 2016 13:02:07 +0300 Subject: [PATCH 06/35] Syndic fix: don't strip 'retcode' and 'success' from events. --- salt/master.py | 4 +-- salt/minion.py | 70 +++++++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/salt/master.py b/salt/master.py index 2a63429e5e..e65d151826 100644 --- a/salt/master.py +++ b/salt/master.py @@ -1399,8 +1399,8 @@ class AESFuncs(object): # Format individual return loads for key, item in six.iteritems(load['return']): ret = {'jid': load['jid'], - 'id': key, - 'return': item} + 'id': key} + ret.update(item) if 'master_id' in load: ret['master_id'] = load['master_id'] if 'fun' in load: diff --git a/salt/minion.py b/salt/minion.py index 95e971cddf..2bffa7ee39 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -2277,41 +2277,44 @@ class Syndic(Minion): def _process_event(self, raw): # TODO: cleanup: Move down into event class mtag, data = self.local.event.unpack(raw, self.local.event.serial) - event = {'data': data, 'tag': mtag} - log.trace('Got event {0}'.format(event['tag'])) # pylint: disable=no-member - tag_parts = event['tag'].split('/') + log.trace('Got event {0}'.format(mtag)) # pylint: disable=no-member + tag_parts = mtag.split('/') if len(tag_parts) >= 4 and tag_parts[1] == 'job' and \ salt.utils.jid.is_jid(tag_parts[2]) and tag_parts[3] == 'ret' and \ - 'return' in event['data']: - if 'jid' not in event['data']: + 'return' in data: + if 'jid' not in data: # Not a job return return - jdict = self.jids.setdefault(event['data']['jid'], {}) + jdict = self.jids.setdefault(data['jid'], {}) if not jdict: - jdict['__fun__'] = event['data'].get('fun') - jdict['__jid__'] = event['data']['jid'] + jdict['__fun__'] = data.get('fun') + jdict['__jid__'] = data['jid'] jdict['__load__'] = {} fstr = '{0}.get_load'.format(self.opts['master_job_cache']) # Only need to forward each load once. Don't hit the disk # for every minion return! - if event['data']['jid'] not in self.jid_forward_cache: + if data['jid'] not in self.jid_forward_cache: jdict['__load__'].update( - self.mminion.returners[fstr](event['data']['jid']) + self.mminion.returners[fstr](data['jid']) ) - self.jid_forward_cache.add(event['data']['jid']) + self.jid_forward_cache.add(data['jid']) if len(self.jid_forward_cache) > self.opts['syndic_jid_forward_cache_hwm']: # Pop the oldest jid from the cache tmp = sorted(list(self.jid_forward_cache)) tmp.pop(0) self.jid_forward_cache = set(tmp) - if 'master_id' in event['data']: + if 'master_id' in data: # __'s to make sure it doesn't print out on the master cli - jdict['__master_id__'] = event['data']['master_id'] - jdict[event['data']['id']] = event['data']['return'] + jdict['__master_id__'] = data['master_id'] + ret = {} + for key in 'return', 'retcode', 'success': + if key in data: + ret[key] = data[key] + jdict[data['id']] = ret else: # Add generic event aggregation here - if 'retcode' not in event['data']: - self.raw_events.append(event) + if 'retcode' not in data: + self.raw_events.append({'data': data, 'tag': mtag}) @tornado.gen.coroutine def _return_pub_multi(self, values): @@ -2583,34 +2586,33 @@ class MultiSyndic(MinionBase): def _process_event(self, raw): # TODO: cleanup: Move down into event class mtag, data = self.local.event.unpack(raw, self.local.event.serial) - event = {'data': data, 'tag': mtag} - log.trace('Got event {0}'.format(event['tag'])) # pylint: disable=no-member + log.trace('Got event {0}'.format(mtag)) # pylint: disable=no-member - tag_parts = event['tag'].split('/') + tag_parts = mtag.split('/') if len(tag_parts) >= 4 and tag_parts[1] == 'job' and \ salt.utils.jid.is_jid(tag_parts[2]) and tag_parts[3] == 'ret' and \ - 'return' in event['data']: - if 'jid' not in event['data']: + 'return' in data: + if 'jid' not in data: # Not a job return return - if self.syndic_mode == 'cluster' and event['data'].get('master_id', 0) == self.opts.get('master_id', 1): + if self.syndic_mode == 'cluster' and data.get('master_id', 0) == self.opts.get('master_id', 1): log.debug('Return received with matching master_id, not forwarding') return - master = event['data'].get('master_id') - jdict = self.job_rets.setdefault(master, {}).setdefault(event['tag'], {}) + master = data.get('master_id') + jdict = self.job_rets.setdefault(master, {}).setdefault(mtag, {}) if not jdict: - jdict['__fun__'] = event['data'].get('fun') - jdict['__jid__'] = event['data']['jid'] + jdict['__fun__'] = data.get('fun') + jdict['__jid__'] = data['jid'] jdict['__load__'] = {} fstr = '{0}.get_load'.format(self.opts['master_job_cache']) # Only need to forward each load once. Don't hit the disk # for every minion return! - if event['data']['jid'] not in self.jid_forward_cache: + if data['jid'] not in self.jid_forward_cache: jdict['__load__'].update( - self.mminion.returners[fstr](event['data']['jid']) + self.mminion.returners[fstr](data['jid']) ) - self.jid_forward_cache.add(event['data']['jid']) + self.jid_forward_cache.add(data['jid']) if len(self.jid_forward_cache) > self.opts['syndic_jid_forward_cache_hwm']: # Pop the oldest jid from the cache tmp = sorted(list(self.jid_forward_cache)) @@ -2619,15 +2621,19 @@ class MultiSyndic(MinionBase): if master is not None: # __'s to make sure it doesn't print out on the master cli jdict['__master_id__'] = master - jdict[event['data']['id']] = event['data']['return'] + ret = {} + for key in 'return', 'retcode', 'success': + if key in data: + ret[key] = data[key] + jdict[data['id']] = ret else: # TODO: config to forward these? If so we'll have to keep track of who # has seen them # if we are the top level masters-- don't forward all the minion events if self.syndic_mode == 'sync': # Add generic event aggregation here - if 'retcode' not in event['data']: - self.raw_events.append(event) + if 'retcode' not in data: + self.raw_events.append({'data': data, 'tag': mtag}) def _forward_events(self): log.trace('Forwarding events') # pylint: disable=no-member From 27aa038cc6ce54b3e983fac9f59c4f9f864fb115 Mon Sep 17 00:00:00 2001 From: Jingran Lin Date: Thu, 18 Aug 2016 10:27:48 +0100 Subject: [PATCH 07/35] Fix highstate outputter when it's given multiple results This fixes issue #25664 --- salt/output/highstate.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/salt/output/highstate.py b/salt/output/highstate.py index cd7e50ed31..5a1ac6c8b2 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -130,12 +130,15 @@ def output(data): if 'data' in data: data = data.pop('data') - for host, hostdata in six.iteritems(data): - if not isinstance(hostdata, dict): - # Highstate return data must be a dict, if this is not the case - # then this value is likely a retcode. - continue - return _format_host(host, hostdata)[0] + ret = [ + _format_host(host, hostdata)[0] + for host, hostdata in six.iteritems(data) + # Highstate return data must be a dict, if this is not the case + # then this value is likely a retcode. + if isinstance(hostdata, dict) + ] + if ret: + return "\n".join(ret) log.error( 'Data passed to highstate outputter is not a valid highstate return: %s', data From d4336d011c22dfb31921e2c67fba9fce8d9eb434 Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Thu, 18 Aug 2016 10:09:05 -0600 Subject: [PATCH 08/35] [1,2,3] -> range(1,4) --- salt/modules/cassandra_cql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 7cc18d197e..c177a2cc48 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -249,7 +249,7 @@ def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, auth_provider=auth_provider, protocol_version=protocol_version, compression=True) - for recontimes in [1, 2, 3]: + for recontimes in range(1, 4): try: session = cluster.connect() break From 30f42d53520a2978c6fe0f85fe1af51e7770e924 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 18 Aug 2016 11:01:32 -0600 Subject: [PATCH 09/35] Write test for multiple unless commands where 1st cmd passes and 2nd fails This is a regression integration test for #35384, which was fixed by #35545, and back-ported to the 2015.8 branch in #35566. --- .../integration/files/file/base/issue-35384.sls | 6 ++++++ tests/integration/states/cmd.py | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/integration/files/file/base/issue-35384.sls diff --git a/tests/integration/files/file/base/issue-35384.sls b/tests/integration/files/file/base/issue-35384.sls new file mode 100644 index 0000000000..82214b7d3e --- /dev/null +++ b/tests/integration/files/file/base/issue-35384.sls @@ -0,0 +1,6 @@ +cmd_run_unless_multiple: + cmd.run: + - name: echo "hello" + - unless: + - /bin/true + - /bin/false diff --git a/tests/integration/states/cmd.py b/tests/integration/states/cmd.py index d7f7f98eba..1a2ac4504e 100644 --- a/tests/integration/states/cmd.py +++ b/tests/integration/states/cmd.py @@ -87,6 +87,22 @@ class CMDTest(integration.ModuleCase, os.remove(state_file) os.remove(unless_file) + def test_run_unless_multiple_cmds(self): + ''' + test cmd.run using multiple unless options where the first cmd in the + list will pass, but the second will fail. This tests the fix for issue + #35384. (The fix is in PR #35545.) + ''' + sls = self.run_function('state.sls', mods='issue-35384') + self.assertSaltTrueReturn(sls) + # We must assert against the comment here to make sure the comment reads that the + # command "echo "hello"" was run. This ensures that we made it to the last unless + # command in the state. If the comment reads "unless execution succeeded", or similar, + # then the unless state run bailed out after the first unless command succeeded, + # which is the bug we're regression testing for. + self.assertEqual(sls['cmd_|-cmd_run_unless_multiple_|-echo "hello"_|-run']['comment'], + 'Command "echo "hello"" run') + def test_run_creates_exists(self): ''' test cmd.run creates already there From 7e87d4170d9f7c4b246cdb91dc6a0b7ce6e312d1 Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Thu, 18 Aug 2016 11:26:42 -0600 Subject: [PATCH 10/35] Fix Py3 lint? --- salt/modules/cassandra_cql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index c177a2cc48..7ee2dfbd59 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -84,7 +84,7 @@ import ssl # Import Salt Libs from salt.exceptions import CommandExecutionError -from salt.ext import six +import salt.ext.six as six SSL_VERSION = 'ssl_version' From 0b01a7a266019f2139acecd3570af45ce847474d Mon Sep 17 00:00:00 2001 From: "C. R. Oldham" Date: Thu, 18 Aug 2016 12:30:31 -0600 Subject: [PATCH 11/35] Six import for range. --- salt/modules/cassandra_cql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 7ee2dfbd59..e443d0d1e3 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -85,6 +85,7 @@ import ssl # Import Salt Libs from salt.exceptions import CommandExecutionError import salt.ext.six as six +from salt.ext.six.moves import range SSL_VERSION = 'ssl_version' From 69fad464ab61c9bea73533a5e287e897668c8b67 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 14:43:34 -0500 Subject: [PATCH 12/35] pkg/salt-api.service: change Type to notify --- pkg/salt-api.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/salt-api.service b/pkg/salt-api.service index 72379ba08d..877558d1d7 100644 --- a/pkg/salt-api.service +++ b/pkg/salt-api.service @@ -3,7 +3,7 @@ Description=The Salt API After=network.target [Service] -Type=simple +Type=notify LimitNOFILE=8192 ExecStart=/usr/bin/salt-api TimeoutStopSec=3 From 540ec289545cc7a871971d436d6286ee309c2cd2 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 14:43:34 -0500 Subject: [PATCH 13/35] pkg/salt-master.service: remove KillMode --- pkg/salt-master.service | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/salt-master.service b/pkg/salt-master.service index 0eadf88a38..1f4650f872 100644 --- a/pkg/salt-master.service +++ b/pkg/salt-master.service @@ -7,7 +7,6 @@ LimitNOFILE=16384 Type=notify NotifyAccess=all ExecStart=/usr/bin/salt-master -KillMode=process [Install] WantedBy=multi-user.target From 175ba99e0e2b066639eb37cb7d5f2b8dbaaf0695 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 14:43:34 -0500 Subject: [PATCH 14/35] pkg/salt-minion.service: remove KillMode, change Type to notify --- pkg/salt-minion.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/salt-minion.service b/pkg/salt-minion.service index fb1d5170a2..939326cdaa 100644 --- a/pkg/salt-minion.service +++ b/pkg/salt-minion.service @@ -3,10 +3,9 @@ Description=The Salt Minion After=network.target [Service] -Type=simple +Type=notify LimitNOFILE=8192 ExecStart=/usr/bin/salt-minion -KillMode=process [Install] WantedBy=multi-user.target From 6cb0fb47f35078aaa47960ca6af3add2030fbbbd Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 14:43:34 -0500 Subject: [PATCH 15/35] pkg/salt-syndic.service: change Type to notify --- pkg/salt-syndic.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/salt-syndic.service b/pkg/salt-syndic.service index 4b72f84286..95ffc18d96 100644 --- a/pkg/salt-syndic.service +++ b/pkg/salt-syndic.service @@ -3,7 +3,7 @@ Description=The Salt Master Server After=network.target [Service] -Type=simple +Type=notify LimitNOFILE=8192 ExecStart=/usr/bin/salt-syndic From 52feff93092b3c2aadbd17143333573292f61e3b Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 18 Aug 2016 14:58:20 -0600 Subject: [PATCH 16/35] Fix mac_service attempts to parse non-plist files --- salt/modules/mac_service.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/salt/modules/mac_service.py b/salt/modules/mac_service.py index f78c985549..bf804ccd9f 100644 --- a/salt/modules/mac_service.py +++ b/salt/modules/mac_service.py @@ -71,9 +71,15 @@ def _available_services(): for launch_dir in _launchd_paths(): for root, dirs, files in os.walk(launch_dir): for file_name in files: - file_path = os.path.join(root, file_name) + + # Must be a plist file + if not file_name.endswith('.plist'): + continue + # Follow symbolic links of files in _launchd_paths + file_path = os.path.join(root, file_name) true_path = os.path.realpath(file_path) + # ignore broken symlinks if not os.path.exists(true_path): continue @@ -89,8 +95,7 @@ def _available_services(): # the system provided plutil program to do the conversion cmd = '/usr/bin/plutil -convert xml1 -o - -- "{0}"'.format( true_path) - plist_xml = __salt__['cmd.run']( - cmd, python_shell=False, output_loglevel='trace') + plist_xml = __salt__['cmd.run'](cmd, output_loglevel='quiet') if six.PY2: plist = plistlib.readPlistFromString(plist_xml) else: From fd08d33597116ca0331c7487759650778a3e038b Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 18:00:02 -0500 Subject: [PATCH 17/35] Add warning about AWS flagging of nmap usage (#35575) * Add warning about AWS flagging of nmap usage Also improve the verification examples overall, and add a note about the fingerprint display difference beginning in OpenSSH 6.8. * Remove "as root" For some reason, when I was running the test in the example, I wasn't getting the script output for the host key, unless I ran as root. Don't know why this was the case but I can't reproduce it now. Removing this as it is not accurate. Also added a port number to the example as well since it speeds up the nmap command. --- doc/topics/tutorials/gitfs.rst | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/topics/tutorials/gitfs.rst b/doc/topics/tutorials/gitfs.rst index 4927fc2b17..c689d122da 100644 --- a/doc/topics/tutorials/gitfs.rst +++ b/doc/topics/tutorials/gitfs.rst @@ -697,7 +697,7 @@ server via SSH: .. code-block:: bash - $ su + $ su - Password: # ssh github.com The authenticity of host 'github.com (192.30.252.128)' can't be established. @@ -713,11 +713,11 @@ Verifying the Fingerprint ~~~~~~~~~~~~~~~~~~~~~~~~~ To verify that the correct fingerprint was added, it is a good idea to look it -up. One way to do this is to use nmap: +up. One way to do this is to use ``nmap``: .. code-block:: bash - $ nmap github.com --script ssh-hostkey + $ nmap -p 22 github.com --script ssh-hostkey Starting Nmap 5.51 ( http://nmap.org ) at 2014-08-18 17:47 CDT Nmap scan report for github.com (192.30.252.129) @@ -733,13 +733,24 @@ up. One way to do this is to use nmap: Nmap done: 1 IP address (1 host up) scanned in 28.78 seconds -Another way is to check one's own known_hosts file, using this one-liner: +Another way is to check one's own ``known_hosts`` file, using this one-liner: .. code-block:: bash - $ ssh-keygen -l -f /dev/stdin <<<`ssh-keyscan -t rsa github.com 2>/dev/null` | awk '{print $2}' + $ ssh-keygen -l -f /dev/stdin <<<`ssh-keyscan github.com 2>/dev/null` | awk '{print $2}' 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 +.. warning:: + AWS tracks usage of nmap and may flag it as abuse. On AWS hosts, the + ``ssh-keygen`` method is recommended for host key verification. + +.. note:: + As of `OpenSSH 6.8`_ the SSH fingerprint is now shown as a base64-encoded + SHA256 checksum of the host key. So, instead of the fingerprint looking + like ``16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48``, it would look + like ``SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8``. + +.. _`OpenSSH 6.8`: http://www.openssh.com/txt/release-6.8 Refreshing gitfs Upon Push ========================== From 4122e66ed577ebd24f740bc541631d55db38d836 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 18 Aug 2016 17:07:16 -0600 Subject: [PATCH 18/35] Handle malformed plist files --- salt/modules/mac_service.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/salt/modules/mac_service.py b/salt/modules/mac_service.py index bf804ccd9f..723ed9e3d2 100644 --- a/salt/modules/mac_service.py +++ b/salt/modules/mac_service.py @@ -102,11 +102,17 @@ def _available_services(): plist = plistlib.readPlistFromBytes( salt.utils.to_bytes(plist_xml)) - available_services[plist.Label.lower()] = { - 'file_name': file_name, - 'file_path': true_path, - 'plist': plist, - } + try: + available_services[plist.Label.lower()] = { + 'file_name': file_name, + 'file_path': true_path, + 'plist': plist} + except AttributeError: + # Handle malformed plist files + available_services[os.path.basename(file_name).lower()] = { + 'file_name': file_name, + 'file_path': true_path, + 'plist': plist} return available_services From beb6ca8ef9e7fd05d9412c6aa14df32a2fcd0b69 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 21:56:08 -0500 Subject: [PATCH 19/35] Update linux_sysctl tests to reflect new context key (#35584) * Update docstring to reflect optional context argument It used to not be optional. * Update linux_sysctl tests to reflect new context key This key was changed in 5b12f03, this updates the tests to reflect the change. --- salt/utils/systemd.py | 7 ++++--- tests/unit/modules/linux_sysctl_test.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/salt/utils/systemd.py b/salt/utils/systemd.py index 03a474954a..270e296603 100644 --- a/salt/utils/systemd.py +++ b/salt/utils/systemd.py @@ -17,9 +17,10 @@ log = logging.getLogger(__name__) def booted(context=None): ''' - Return True if the system was booted with systemd, False otherwise. - Pass in the loader context "__context__", this function will set the - systemd.sd_booted key to represent if systemd is running + Return True if the system was booted with systemd, False otherwise. If the + loader context dict ``__context__`` is passed, this function will set the + ``salt.utils.systemd.booted`` key to represent if systemd is running and + keep the logic below from needing to be run again during the same salt run. ''' contextkey = 'salt.utils.systemd.booted' if isinstance(context, dict): diff --git a/tests/unit/modules/linux_sysctl_test.py b/tests/unit/modules/linux_sysctl_test.py index ca93749a33..aeef75b1fc 100644 --- a/tests/unit/modules/linux_sysctl_test.py +++ b/tests/unit/modules/linux_sysctl_test.py @@ -113,7 +113,7 @@ class LinuxSysctlTestCase(TestCase): {'cmd.run_stdout': mock_sys_cmd, 'cmd.run_all': mock_asn_cmd}): with patch.dict(systemd.__context__, - {'systemd.sd_booted': True}): + {'salt.utils.systemd.booted': True}): linux_sysctl.persist('net.ipv4.ip_forward', 1) helper_open = m_open() helper_open.write.assert_called_once_with( @@ -136,7 +136,7 @@ class LinuxSysctlTestCase(TestCase): {'cmd.run_stdout': mock_sys_cmd, 'cmd.run_all': mock_asn_cmd}): with patch.dict(systemd.__context__, - {'systemd.sd_booted': True}): + {'salt.utils.systemd.booted': True}): self.assertEqual(linux_sysctl.persist( 'net.ipv4.ip_forward', 1), 'Updated') From 4f0b3be20cbf8f09d7aeb6d4c3feba5a44fa9033 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 18 Aug 2016 21:56:20 -0500 Subject: [PATCH 20/35] Fix localemod tests (#35583) This changes the mocking for the context variables to reflect changes made in 5b12f03. --- tests/unit/modules/localemod_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/modules/localemod_test.py b/tests/unit/modules/localemod_test.py index ee8c4daaa1..508b039bf4 100644 --- a/tests/unit/modules/localemod_test.py +++ b/tests/unit/modules/localemod_test.py @@ -58,7 +58,7 @@ class LocalemodTestCase(TestCase): self.assertEqual('A', localemod.get_locale()) localemod._parse_localectl.assert_called_once_with() - with patch.dict(localemod.__context__, {'systemd.sd_booted': False}): + with patch.dict(localemod.__context__, {'salt.utils.systemd.booted': False}): with patch.dict(localemod.__grains__, {'os_family': ['Gentoo']}): with patch.dict(localemod.__salt__, {'cmd.run': MagicMock(return_value='A')}): self.assertEqual(localemod.get_locale(), 'A') @@ -78,7 +78,7 @@ class LocalemodTestCase(TestCase): with patch.object(localemod, '_localectl_set', return_value=True): self.assertTrue(localemod.set_locale('l')) - with patch.dict(localemod.__context__, {'systemd.sd_booted': False}): + with patch.dict(localemod.__context__, {'salt.utils.systemd.booted': False}): with patch.dict(localemod.__grains__, {'os_family': ['Gentoo']}): with patch.dict(localemod.__salt__, {'cmd.retcode': MagicMock(return_value='A')}): self.assertFalse(localemod.set_locale('l')) From 2d3a882cc2b998c7e4e7ba4b336b56dee0384f15 Mon Sep 17 00:00:00 2001 From: Hengyang Hu Date: Thu, 18 Aug 2016 23:11:55 -0700 Subject: [PATCH 21/35] fix 35420, add run_on_start in build_schedule_item, remove redundancy of enabled --- salt/modules/schedule.py | 7 +------ salt/states/schedule.py | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/salt/modules/schedule.py b/salt/modules/schedule.py index acf1eb8850..f524539ca4 100644 --- a/salt/modules/schedule.py +++ b/salt/modules/schedule.py @@ -359,15 +359,10 @@ def build_schedule_item(name, **kwargs): schedule[name]['splay'] = kwargs['splay'] for item in ['range', 'when', 'once', 'once_fmt', 'cron', 'returner', - 'return_config', 'return_kwargs', 'until', 'enabled']: + 'return_config', 'return_kwargs', 'until', 'run_on_start']: if item in kwargs: schedule[name][item] = kwargs[item] - # if enabled is not included in the job, - # assume job is enabled. - if 'enabled' not in kwargs: - schedule[name]['enabled'] = True - return schedule[name] diff --git a/salt/states/schedule.py b/salt/states/schedule.py index 5fc6ccd484..2e977d09a3 100644 --- a/salt/states/schedule.py +++ b/salt/states/schedule.py @@ -117,6 +117,10 @@ def present(name, using the crontab format. Requires python-croniter. + run_on_start + Whether the job will run when Salt minion start. Value should be + a boolean. + function The function that should be executed by the scheduled job. From dd12b482391fec23975234bcd5b1d5dfcb4c137a Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 09:59:31 -0600 Subject: [PATCH 22/35] Update release notes for 2015.8.12 (#35599) --- doc/topics/releases/2015.8.12.rst | 188 ++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/doc/topics/releases/2015.8.12.rst b/doc/topics/releases/2015.8.12.rst index 821c13df48..32912298e2 100644 --- a/doc/topics/releases/2015.8.12.rst +++ b/doc/topics/releases/2015.8.12.rst @@ -4,3 +4,191 @@ Salt 2015.8.12 Release Notes Version 2015.8.12 is a bugfix release for :doc:`2015.8.0 `. + + +Changes for v2015.8.11..v2015.8.12 +---------------------------------- + +Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs): + +*Generated at: 2016-08-19T15:51:29Z* + +Total Merges: **41** + +Changes: + +- **PR** `#35394`_: (*rallytime*) Back-port `#34573`_ to 2015.8 +- **PR** `#34573`_: (*cedwards*) Update freebsd.rst +- **PR** `#35359`_: (*terminalmage*) Clean up open filehandles +- **PR** `#35339`_: (*isbm*) Bugfix: Prevent continuous restart, if a dependency wasn't installed +- **PR** `#35357`_: (*twangboy*) Fix file.recurse with clean: True on Windows (2015.8) +- **PR** `#35323`_: (*thatch45*) Fix issue with bad error check in salt-vt +- **PR** `#35325`_: (*kev009*) Fix freebsd netstat route on fbsd 10+ +- **PR** `#35301`_: (*bobrik*) Pass port to ssh.check_known_host, closes `#35264`_ +- **PR** `#35309`_: (*terminalmage*) file.recurse: Do not convert octal mode string to int +- **PR** `#35290`_: (*terminalmage*) Resolve a couple bugs in orchestration output +- **PR** `#35211`_: (*cachedout*) Alternative sudo users for salt-ssh +- **PR** `#35271`_: (*bobrik*) Default state_output_profile to True everywhere, closes `#35166`_ +- **PR** `#35233`_: (*terminalmage*) Do not attempt to get fqdn_ip{4,6} grains when ipv{4,6} grains are empty +- **PR** `#35202`_: (*multani*) doc: fix broken links in the test documentation page +- **PR** `#35236`_: (*rallytime*) Back-port `#35119`_ to 2015.8 +- **PR** `#35119`_: (*derekmaciel*) Assume two EVRs are equal if E and V are equal but one R is missing. +- **PR** `#35240`_: (*derekmaciel*) Backport `#35225`_ to 2015.8 +- **PR** `#35225`_: (*derekmaciel*) Add missing documentation for pkg.installed +- **PR** `#35241`_: (*terminalmage*) Ensure max recursion in gitfs results in no blob object being returned. +- **PR** `#35245`_: (*rallytime*) Back-port `#35039`_ to 2015.8 +- **PR** `#35039`_: (*whiteinge*) Add saltenv support to module.run +- **PR** `#35249`_: (*terminalmage*) Fix regression in git.latest +- **PR** `#35174`_: (*rallytime*) Back-port `#35146`_ to 2015.8 +- **PR** `#35146`_: (*cachedout*) Don't discard running beacons config when listing becaons +- **PR** `#34827`_: (*thatch45*) fix beacon list to include all beacons being processed +- **PR** `#35173`_: (*rallytime*) Back-port `#35135`_ to 2015.8 +- **PR** `#35135`_: (*rallytime*) Add missing CLI Examples to aws_sqs module funcs +- **PR** `#35145`_: (*jacobhammons*) doc version update to 2015.8.11, updates to release notes +- **PR** `#35114`_: (*terminalmage*) Add clarification docs on a common git_pillar misconfiguration +- **PR** `#34768`_: (*hrumph*) Fixes `#34767`_ +- **PR** `#35043`_: (*rallytime*) Start release notes file for 2015.8.12 +- **PR** `#35050`_: (*terminalmage*) [orchestration] Properly handle runner/wheel funcs which accept a 'saltdev' argument +- **PR** `#35066`_: (*jfindlay*) returners.postgres_local_cache: do not log in __virtual__ +- **PR** `#35024`_: (*bobrik*) Cache systemd unit update check per unit, closes `#34927`_ +- **PR** `#35026`_: (*cachedout*) Expressly deny a minion if a key cannot be found +- **PR** `#35000`_: (*rallytime*) Back-port `#33875`_ and `#34999`_ to 2015.8 +- **PR** `#33875`_: (*jmesquita*) Fix naive fileserver map diff algorithm +- **PR** `#34994`_: (*rallytime*) Back-port `#34835`_ to 2015.8 +- **PR** `#34835`_: (*thatch45*) Make the mine and publish combine minion and master opts in salt-ssh +- **PR** `#34991`_: (*cachedout*) SSH timeout +- **PR** `#34976`_: (*cachedout*) Refine errors in client +- **PR** `#34831`_: (*thatch45*) If the thin does not match, then redeploy, don't error +- **PR** `#34916`_: (*cachedout*) Master performance improvement +- **PR** `#34911`_: (*cachedout*) Backport `#34906`_ +- **PR** `#34906`_: (*cachedout*) Set timeout for run_salt in test suite +- **PR** `#34898`_: (*hrumph*) Stop multiple refreshes during call to pkg.list_upgrades +- **PR** `#34606`_: (*isbm*) Bugfix: Exit on configuration read (backport) +- **PR** `#34862`_: (*thatch45*) Fix salt-ssh cacheing issue +- **PR** `#34869`_: (*terminalmage*) Fail git.latest states with uncommitted changes when force_reset=False +- **PR** `#34859`_: (*cachedout*) Fix wheel test +- **PR** `#34822`_: (*thatch45*) Fix salt-ssh state.high and state.low +- **PR** `#34847`_: (*cachedout*) Add an option to skip the verification of client_acl users +- **PR** `#34827`_: (*thatch45*) fix beacon list to include all beacons being processed +- **PR** `#34833`_: (*rallytime*) Back-port `#28521`_ to 2015.8 +- **PR** `#28521`_: (*gongled*) SPM: packaging doesn't work in Python 2.6. Fixed. +- **PR** `#34823`_: (*rallytime*) Back-port `#25276`_ to 2015.8 +- **PR** `#25276`_: (*jacobhammons*) copy spm.1 man page during setup +- **PR** `#34828`_: (*thatch45*) Fix `#34648`_ +- **PR** `#34818`_: (*jtand*) Skip mysql state test if mysqladmin is not available +- **PR** `#34642`_: (*jtand*) Check that mysqladmin exists before running mysql integration tests +- **PR** `#34803`_: (*junovitch*) salt/state.py: set `chunk['order'] = 0' with `order: first'; fixes `#24744`_ +- **PR** `#34773`_: (*randomed*) Bugfix: Startup states on minions are not being written to mysql returner +- **PR** `#34751`_: (*cachedout*) Remove unnedeed config test +- **PR** `#34606`_: (*isbm*) Bugfix: Exit on configuration read (backport) +- **PR** `#34754`_: (*cachedout*) Disable test +- **PR** `#34741`_: (*rallytime*) Back-port `#34726`_ to 2015.8 +- **PR** `#34726`_: (*martinhoefling*) Always loop over updated keys in non recursive update +- **PR** `#34721`_: (*rallytime*) Add output_file option to master config docs +- **PR** `#34689`_: (*Azidburn*) fix second run problems with pkg.installed using sources +- **PR** `#34695`_: (*isbm*) Bugfix: Zypper `pkg.list_products` returns False on some empty values (2015.8) + +.. _`#24744`: https://github.com/saltstack/salt/issues/24744 +.. _`#25213`: https://github.com/saltstack/salt/issues/25213 +.. _`#25276`: https://github.com/saltstack/salt/pull/25276 +.. _`#26278`: https://github.com/saltstack/salt/issues/26278 +.. _`#27783`: https://github.com/saltstack/salt/issues/27783 +.. _`#28521`: https://github.com/saltstack/salt/pull/28521 +.. _`#29785`: https://github.com/saltstack/salt/issues/29785 +.. _`#31074`: https://github.com/saltstack/salt/issues/31074 +.. _`#32276`: https://github.com/saltstack/salt/issues/32276 +.. _`#32719`: https://github.com/saltstack/salt/issues/32719 +.. _`#33620`: https://github.com/saltstack/salt/issues/33620 +.. _`#33875`: https://github.com/saltstack/salt/pull/33875 +.. _`#34509`: https://github.com/saltstack/salt/issues/34509 +.. _`#34526`: https://github.com/saltstack/salt/issues/34526 +.. _`#34573`: https://github.com/saltstack/salt/pull/34573 +.. _`#34606`: https://github.com/saltstack/salt/pull/34606 +.. _`#34642`: https://github.com/saltstack/salt/pull/34642 +.. _`#34648`: https://github.com/saltstack/salt/issues/34648 +.. _`#34678`: https://github.com/saltstack/salt/issues/34678 +.. _`#34689`: https://github.com/saltstack/salt/pull/34689 +.. _`#34691`: https://github.com/saltstack/salt/issues/34691 +.. _`#34695`: https://github.com/saltstack/salt/pull/34695 +.. _`#34703`: https://github.com/saltstack/salt/issues/34703 +.. _`#34721`: https://github.com/saltstack/salt/pull/34721 +.. _`#34725`: https://github.com/saltstack/salt/issues/34725 +.. _`#34726`: https://github.com/saltstack/salt/pull/34726 +.. _`#34741`: https://github.com/saltstack/salt/pull/34741 +.. _`#34751`: https://github.com/saltstack/salt/pull/34751 +.. _`#34754`: https://github.com/saltstack/salt/pull/34754 +.. _`#34767`: https://github.com/saltstack/salt/issues/34767 +.. _`#34768`: https://github.com/saltstack/salt/pull/34768 +.. _`#34773`: https://github.com/saltstack/salt/pull/34773 +.. _`#34796`: https://github.com/saltstack/salt/issues/34796 +.. _`#34798`: https://github.com/saltstack/salt/issues/34798 +.. _`#34803`: https://github.com/saltstack/salt/pull/34803 +.. _`#34818`: https://github.com/saltstack/salt/pull/34818 +.. _`#34822`: https://github.com/saltstack/salt/pull/34822 +.. _`#34823`: https://github.com/saltstack/salt/pull/34823 +.. _`#34827`: https://github.com/saltstack/salt/pull/34827 +.. _`#34828`: https://github.com/saltstack/salt/pull/34828 +.. _`#34831`: https://github.com/saltstack/salt/pull/34831 +.. _`#34833`: https://github.com/saltstack/salt/pull/34833 +.. _`#34835`: https://github.com/saltstack/salt/pull/34835 +.. _`#34847`: https://github.com/saltstack/salt/pull/34847 +.. _`#34859`: https://github.com/saltstack/salt/pull/34859 +.. _`#34861`: https://github.com/saltstack/salt/issues/34861 +.. _`#34862`: https://github.com/saltstack/salt/pull/34862 +.. _`#34869`: https://github.com/saltstack/salt/pull/34869 +.. _`#34898`: https://github.com/saltstack/salt/pull/34898 +.. _`#34906`: https://github.com/saltstack/salt/pull/34906 +.. _`#34911`: https://github.com/saltstack/salt/pull/34911 +.. _`#34916`: https://github.com/saltstack/salt/pull/34916 +.. _`#34927`: https://github.com/saltstack/salt/issues/34927 +.. _`#34945`: https://github.com/saltstack/salt/issues/34945 +.. _`#34976`: https://github.com/saltstack/salt/pull/34976 +.. _`#34991`: https://github.com/saltstack/salt/pull/34991 +.. _`#34994`: https://github.com/saltstack/salt/pull/34994 +.. _`#34999`: https://github.com/saltstack/salt/issues/34999 +.. _`#35000`: https://github.com/saltstack/salt/pull/35000 +.. _`#35024`: https://github.com/saltstack/salt/pull/35024 +.. _`#35026`: https://github.com/saltstack/salt/pull/35026 +.. _`#35039`: https://github.com/saltstack/salt/pull/35039 +.. _`#35043`: https://github.com/saltstack/salt/pull/35043 +.. _`#35050`: https://github.com/saltstack/salt/pull/35050 +.. _`#35051`: https://github.com/saltstack/salt/issues/35051 +.. _`#35066`: https://github.com/saltstack/salt/pull/35066 +.. _`#35114`: https://github.com/saltstack/salt/pull/35114 +.. _`#35119`: https://github.com/saltstack/salt/pull/35119 +.. _`#35135`: https://github.com/saltstack/salt/pull/35135 +.. _`#35145`: https://github.com/saltstack/salt/pull/35145 +.. _`#35146`: https://github.com/saltstack/salt/pull/35146 +.. _`#35166`: https://github.com/saltstack/salt/issues/35166 +.. _`#35173`: https://github.com/saltstack/salt/pull/35173 +.. _`#35174`: https://github.com/saltstack/salt/pull/35174 +.. _`#35202`: https://github.com/saltstack/salt/pull/35202 +.. _`#35211`: https://github.com/saltstack/salt/pull/35211 +.. _`#35214`: https://github.com/saltstack/salt/issues/35214 +.. _`#35225`: https://github.com/saltstack/salt/pull/35225 +.. _`#35233`: https://github.com/saltstack/salt/pull/35233 +.. _`#35236`: https://github.com/saltstack/salt/pull/35236 +.. _`#35240`: https://github.com/saltstack/salt/pull/35240 +.. _`#35241`: https://github.com/saltstack/salt/pull/35241 +.. _`#35245`: https://github.com/saltstack/salt/pull/35245 +.. _`#35249`: https://github.com/saltstack/salt/pull/35249 +.. _`#35264`: https://github.com/saltstack/salt/issues/35264 +.. _`#35271`: https://github.com/saltstack/salt/pull/35271 +.. _`#35290`: https://github.com/saltstack/salt/pull/35290 +.. _`#35301`: https://github.com/saltstack/salt/pull/35301 +.. _`#35309`: https://github.com/saltstack/salt/pull/35309 +.. _`#35323`: https://github.com/saltstack/salt/pull/35323 +.. _`#35325`: https://github.com/saltstack/salt/pull/35325 +.. _`#35339`: https://github.com/saltstack/salt/pull/35339 +.. _`#35357`: https://github.com/saltstack/salt/pull/35357 +.. _`#35359`: https://github.com/saltstack/salt/pull/35359 +.. _`#35394`: https://github.com/saltstack/salt/pull/35394 +.. _`bp-25276`: https://github.com/saltstack/salt/pull/25276 +.. _`bp-28521`: https://github.com/saltstack/salt/pull/28521 +.. _`bp-33875`: https://github.com/saltstack/salt/pull/33875 +.. _`bp-34726`: https://github.com/saltstack/salt/pull/34726 +.. _`bp-34835`: https://github.com/saltstack/salt/pull/34835 +.. _`bp-35039`: https://github.com/saltstack/salt/pull/35039 +.. _`bp-35119`: https://github.com/saltstack/salt/pull/35119 +.. _`bp-35225`: https://github.com/saltstack/salt/pull/35225 +.. _`fix-34703`: https://github.com/saltstack/salt/issues/34703 From 0c7aa802f5a3503523d751acd7647f7517aa56b4 Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 10:13:41 -0600 Subject: [PATCH 23/35] Update release notes for 2015.8.12 (#35600) --- doc/topics/releases/2015.8.12.rst | 74 ++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/doc/topics/releases/2015.8.12.rst b/doc/topics/releases/2015.8.12.rst index 32912298e2..11673aff24 100644 --- a/doc/topics/releases/2015.8.12.rst +++ b/doc/topics/releases/2015.8.12.rst @@ -11,12 +11,41 @@ Changes for v2015.8.11..v2015.8.12 Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs): -*Generated at: 2016-08-19T15:51:29Z* +*Generated at: 2016-08-19T16:06:27Z* -Total Merges: **41** +Total Merges: **57** Changes: +- **PR** `#35599`_: (*rallytime*) Update release notes for 2015.8.12 +- **PR** `#35584`_: (*terminalmage*) Update linux_sysctl tests to reflect new context key +- **PR** `#35575`_: (*terminalmage*) Add warning about AWS flagging of nmap usage +- **PR** `#35577`_: (*terminalmage*) Unit file changes for 2015.8.12, 2016.3.3 +- **PR** `#35566`_: (*rallytime*) Back-port `#35545`_ to 2015.8 +- **PR** `#35545`_: (*hu-dabao*) `fix-35384`_, fix cmd.run unless +- **PR** `#35492`_: (*terminalmage*) Clarify config.get docstring +- **PR** `#35483`_: (*gtmanfred*) use __utils__ in salt.cloud +- **PR** `#35546`_: (*whiteinge*) Salt api eauth fail gracefully +- **PR** `#35525`_: (*UtahDave*) add missing glob import +- **PR** `#35540`_: (*rallytime*) Whitespace fix for 2015.8 +- **PR** `#35510`_: (*terminalmage*) Better systemd integration +- **PR** `#35513`_: (*cachedout*) Might be a good idea to be able to download the software we make +- **PR** `#35302`_: (*Ch3LL*) Add job cache test +- **PR** `#35512`_: (*cachedout*) Fixup 35419 +- **PR** `#35497`_: (*deepakhj*) Fixes spacing in requirements files +- **PR** `#35508`_: (*terminalmage*) Add Carbon to versionadded for git.diff +- **PR** `#35486`_: (*rallytime*) Update bootstrap script to latest stable (2016.08.16) +- **PR** `#35413`_: (*cachedout*) Resolve path issues with cp.push +- **PR** `#35476`_: (*cachedout*) Fixup SSH bug where sudo without sudo user would break +- **PR** `#35471`_: (*terminalmage*) win_pkg: Fix traceback when package is not installed +- **PR** `#35448`_: (*isbm*) Add ignore_repo_failure option to suppress zypper's exit code 106 on … +- **PR** `#35451`_: (*isbm*) Bugfix: zypper mod repo unchanged +- **PR** `#35453`_: (*theothergraham*) fixes `#34279`_ - disk cache ttl expiry +- **PR** `#35459`_: (*thatch45*) Ensure that output for salt-ssh gets back +- **PR** `#35460`_: (*rallytime*) [2015.8] Update bootstrap script to latest stable (2016.08.15) +- **PR** `#35442`_: (*cachedout*) Fix cp.push_dir pushing empty dirs +- **PR** `#35436`_: (*cachedout*) Minor doc fixup +- **PR** `#35132`_: (*sjorge*) fixes , causing lots of mayham (onchange) with 2016.3.2 for me - **PR** `#35394`_: (*rallytime*) Back-port `#34573`_ to 2015.8 - **PR** `#34573`_: (*cedwards*) Update freebsd.rst - **PR** `#35359`_: (*terminalmage*) Clean up open filehandles @@ -88,6 +117,7 @@ Changes: - **PR** `#34689`_: (*Azidburn*) fix second run problems with pkg.installed using sources - **PR** `#34695`_: (*isbm*) Bugfix: Zypper `pkg.list_products` returns False on some empty values (2015.8) +.. _`#18419`: https://github.com/saltstack/salt/issues/18419 .. _`#24744`: https://github.com/saltstack/salt/issues/24744 .. _`#25213`: https://github.com/saltstack/salt/issues/25213 .. _`#25276`: https://github.com/saltstack/salt/pull/25276 @@ -98,8 +128,11 @@ Changes: .. _`#31074`: https://github.com/saltstack/salt/issues/31074 .. _`#32276`: https://github.com/saltstack/salt/issues/32276 .. _`#32719`: https://github.com/saltstack/salt/issues/32719 +.. _`#33516`: https://github.com/saltstack/salt/issues/33516 .. _`#33620`: https://github.com/saltstack/salt/issues/33620 +.. _`#33803`: https://github.com/saltstack/salt/issues/33803 .. _`#33875`: https://github.com/saltstack/salt/pull/33875 +.. _`#34279`: https://github.com/saltstack/salt/issues/34279 .. _`#34509`: https://github.com/saltstack/salt/issues/34509 .. _`#34526`: https://github.com/saltstack/salt/issues/34526 .. _`#34573`: https://github.com/saltstack/salt/pull/34573 @@ -123,6 +156,7 @@ Changes: .. _`#34796`: https://github.com/saltstack/salt/issues/34796 .. _`#34798`: https://github.com/saltstack/salt/issues/34798 .. _`#34803`: https://github.com/saltstack/salt/pull/34803 +.. _`#34806`: https://github.com/saltstack/salt/issues/34806 .. _`#34818`: https://github.com/saltstack/salt/pull/34818 .. _`#34822`: https://github.com/saltstack/salt/pull/34822 .. _`#34823`: https://github.com/saltstack/salt/pull/34823 @@ -147,6 +181,7 @@ Changes: .. _`#34994`: https://github.com/saltstack/salt/pull/34994 .. _`#34999`: https://github.com/saltstack/salt/issues/34999 .. _`#35000`: https://github.com/saltstack/salt/pull/35000 +.. _`#35010`: https://github.com/saltstack/salt/issues/35010 .. _`#35024`: https://github.com/saltstack/salt/pull/35024 .. _`#35026`: https://github.com/saltstack/salt/pull/35026 .. _`#35039`: https://github.com/saltstack/salt/pull/35039 @@ -156,6 +191,8 @@ Changes: .. _`#35066`: https://github.com/saltstack/salt/pull/35066 .. _`#35114`: https://github.com/saltstack/salt/pull/35114 .. _`#35119`: https://github.com/saltstack/salt/pull/35119 +.. _`#35121`: https://github.com/saltstack/salt/issues/35121 +.. _`#35132`: https://github.com/saltstack/salt/pull/35132 .. _`#35135`: https://github.com/saltstack/salt/pull/35135 .. _`#35145`: https://github.com/saltstack/salt/pull/35145 .. _`#35146`: https://github.com/saltstack/salt/pull/35146 @@ -175,14 +212,46 @@ Changes: .. _`#35264`: https://github.com/saltstack/salt/issues/35264 .. _`#35271`: https://github.com/saltstack/salt/pull/35271 .. _`#35290`: https://github.com/saltstack/salt/pull/35290 +.. _`#35296`: https://github.com/saltstack/salt/issues/35296 .. _`#35301`: https://github.com/saltstack/salt/pull/35301 +.. _`#35302`: https://github.com/saltstack/salt/pull/35302 .. _`#35309`: https://github.com/saltstack/salt/pull/35309 .. _`#35323`: https://github.com/saltstack/salt/pull/35323 .. _`#35325`: https://github.com/saltstack/salt/pull/35325 .. _`#35339`: https://github.com/saltstack/salt/pull/35339 .. _`#35357`: https://github.com/saltstack/salt/pull/35357 .. _`#35359`: https://github.com/saltstack/salt/pull/35359 +.. _`#35380`: https://github.com/saltstack/salt/issues/35380 +.. _`#35384`: https://github.com/saltstack/salt/issues/35384 +.. _`#35387`: https://github.com/saltstack/salt/issues/35387 .. _`#35394`: https://github.com/saltstack/salt/pull/35394 +.. _`#35413`: https://github.com/saltstack/salt/pull/35413 +.. _`#35436`: https://github.com/saltstack/salt/pull/35436 +.. _`#35442`: https://github.com/saltstack/salt/pull/35442 +.. _`#35448`: https://github.com/saltstack/salt/pull/35448 +.. _`#35451`: https://github.com/saltstack/salt/pull/35451 +.. _`#35453`: https://github.com/saltstack/salt/pull/35453 +.. _`#35459`: https://github.com/saltstack/salt/pull/35459 +.. _`#35460`: https://github.com/saltstack/salt/pull/35460 +.. _`#35471`: https://github.com/saltstack/salt/pull/35471 +.. _`#35476`: https://github.com/saltstack/salt/pull/35476 +.. _`#35483`: https://github.com/saltstack/salt/pull/35483 +.. _`#35486`: https://github.com/saltstack/salt/pull/35486 +.. _`#35492`: https://github.com/saltstack/salt/pull/35492 +.. _`#35497`: https://github.com/saltstack/salt/pull/35497 +.. _`#35508`: https://github.com/saltstack/salt/pull/35508 +.. _`#35510`: https://github.com/saltstack/salt/pull/35510 +.. _`#35512`: https://github.com/saltstack/salt/pull/35512 +.. _`#35513`: https://github.com/saltstack/salt/pull/35513 +.. _`#35525`: https://github.com/saltstack/salt/pull/35525 +.. _`#35540`: https://github.com/saltstack/salt/pull/35540 +.. _`#35545`: https://github.com/saltstack/salt/pull/35545 +.. _`#35546`: https://github.com/saltstack/salt/pull/35546 +.. _`#35566`: https://github.com/saltstack/salt/pull/35566 +.. _`#35575`: https://github.com/saltstack/salt/pull/35575 +.. _`#35577`: https://github.com/saltstack/salt/pull/35577 +.. _`#35584`: https://github.com/saltstack/salt/pull/35584 +.. _`#35599`: https://github.com/saltstack/salt/pull/35599 .. _`bp-25276`: https://github.com/saltstack/salt/pull/25276 .. _`bp-28521`: https://github.com/saltstack/salt/pull/28521 .. _`bp-33875`: https://github.com/saltstack/salt/pull/33875 @@ -192,3 +261,4 @@ Changes: .. _`bp-35119`: https://github.com/saltstack/salt/pull/35119 .. _`bp-35225`: https://github.com/saltstack/salt/pull/35225 .. _`fix-34703`: https://github.com/saltstack/salt/issues/34703 +.. _`fix-35384`: https://github.com/saltstack/salt/issues/35384 From 83425274f5ffe782a086ce70ce18c66727eb667b Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 10:27:34 -0600 Subject: [PATCH 24/35] Update release notes for 2016.3.3 (#35602) --- doc/topics/releases/2016.3.3.rst | 520 +++++++++++++++++++++++++++++++ 1 file changed, 520 insertions(+) diff --git a/doc/topics/releases/2016.3.3.rst b/doc/topics/releases/2016.3.3.rst index e787b23e14..87ad973d2c 100644 --- a/doc/topics/releases/2016.3.3.rst +++ b/doc/topics/releases/2016.3.3.rst @@ -4,3 +4,523 @@ Salt 2016.3.3 Release Notes Version 2016.3.3 is a bugfix release for :doc:`2016.3.0 `. + + +Changes for v2016.3.2..2016.3 +----------------------------- + +Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs): + +*Generated at: 2016-08-19T16:17:34Z* + +Total Merges: **134** + +Changes: + +- **PR** `#35580`_: (*twangboy*) Fix mac_service attempts to parse non-plist files +- **PR** `#35586`_: (*hu-dabao*) Fix 35420, add run_on_start in build_schedule_item +- **PR** `#35583`_: (*terminalmage*) Fix localemod tests +- **PR** `#35579`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35577`_: (*terminalmage*) Unit file changes for 2015.8.12, 2016.3.3 +- **PR** `#35571`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35566`_: (*rallytime*) Back-port `#35545`_ to 2015.8 +- **PR** `#35546`_: (*whiteinge*) Salt api eauth fail gracefully +- **PR** `#35545`_: (*hu-dabao*) `fix-35384`_, fix cmd.run unless +- **PR** `#35540`_: (*rallytime*) Whitespace fix for 2015.8 +- **PR** `#35525`_: (*UtahDave*) add missing glob import +- **PR** `#35510`_: (*terminalmage*) Better systemd integration +- **PR** `#35492`_: (*terminalmage*) Clarify config.get docstring +- **PR** `#35483`_: (*gtmanfred*) use __utils__ in salt.cloud +- **PR** `#35573`_: (*rallytime*) Back-port `#33337`_ to 2016.3 +- **PR** `#33337`_: (*mzupan*) adding the () to make changes work +- **PR** `#35572`_: (*terminalmage*) Fix poor formatting in pkg state docs +- **PR** `#35545`_: (*hu-dabao*) `fix-35384`_, fix cmd.run unless +- **PR** `#35489`_: (*rallytime*) Back-port `#35463`_ to 2016.3 +- **PR** `#35463`_: (*skizunov*) Make `auth_timeout` user configurable again +- **PR** `#35538`_: (*thatch45*) Treat python XML as an optdep +- **PR** `#35526`_: (*thatch45*) Always deploy the thin to /var/tmp +- **PR** `#35522`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35513`_: (*cachedout*) Might be a good idea to be able to download the software we make +- **PR** `#35512`_: (*cachedout*) Fixup 35419 +- **PR** `#35508`_: (*terminalmage*) Add Carbon to versionadded for git.diff +- **PR** `#35497`_: (*deepakhj*) Fixes spacing in requirements files +- **PR** `#35302`_: (*Ch3LL*) Add job cache test +- **PR** `#35516`_: (*rallytime*) Back-port `#34441`_ to 2016.3 +- **PR** `#34441`_: (*markuskramerIgitt*) Copy and delete silently, do not list each file +- **PR** `#35517`_: (*rallytime*) Back-port `#34502`_ to 2016.3 +- **PR** `#34502`_: (*markuskramerIgitt*) Windows installer build scripts will exit on error +- **PR** `#35429`_: (*tankywoo*) Fix iptables target options with no arguments +- **PR** `#35495`_: (*rallytime*) Use correct deprecated notation instead of a warning for apache_module.enable state function. +- **PR** `#35498`_: (*rallytime*) Add supported templates list to all template doc references in file state +- **PR** `#35406`_: (*rallytime*) Provide links to the renderers in the template docs +- **PR** `#35360`_: (*rallytime*) Add all template registery templates to file.managed docs +- **PR** `#35487`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35486`_: (*rallytime*) Update bootstrap script to latest stable (2016.08.16) +- **PR** `#35476`_: (*cachedout*) Fixup SSH bug where sudo without sudo user would break +- **PR** `#35471`_: (*terminalmage*) win_pkg: Fix traceback when package is not installed +- **PR** `#35460`_: (*rallytime*) [2015.8] Update bootstrap script to latest stable (2016.08.15) +- **PR** `#35459`_: (*thatch45*) Ensure that output for salt-ssh gets back +- **PR** `#35453`_: (*theothergraham*) fixes `#34279`_ - disk cache ttl expiry +- **PR** `#35451`_: (*isbm*) Bugfix: zypper mod repo unchanged +- **PR** `#35448`_: (*isbm*) Add ignore_repo_failure option to suppress zypper's exit code 106 on … +- **PR** `#35413`_: (*cachedout*) Resolve path issues with cp.push +- **PR** `#35446`_: (*cachedout*) Make salt-client aware of edge-case where saltutil might be broken +- **PR** `#35449`_: (*dkruger*) aptpkg will specify --install-recommends if enabled by the SLS +- **PR** `#35467`_: (*rallytime*) Back-port `#33518`_ to 2016.3 +- **PR** `#35235`_: (*rallytime*) Back-port `#33518`_ to 2016.3 +- **PR** `#33518`_: (*tonybaloney*) Fix libcloud bug `#33367`_ +- **PR** `#35461`_: (*rallytime*) [2016.3] Update bootstrap script to latest stable (2016.08.15) +- **PR** `#35456`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35442`_: (*cachedout*) Fix cp.push_dir pushing empty dirs +- **PR** `#35436`_: (*cachedout*) Minor doc fixup +- **PR** `#35132`_: (*sjorge*) fixes , causing lots of mayham (onchange) with 2016.3.2 for me +- **PR** `#35447`_: (*ticosax*) [dockerng] RepoTags can be also be None with docker 1.12 +- **PR** `#35308`_: (*farcaller*) Actually fixed dockerng.list_tags +- **PR** `#34702`_: (*farcaller*) Fixed dockerng.list_tags +- **PR** `#35427`_: (*cachedout*) Correct errant call to argspec from master. Fix ext_job_cache. +- **PR** `#35428`_: (*cachedout*) Resolve stacktrace logged by highstate outputter if sls cannot be found +- **PR** `#35412`_: (*s0undt3ch*) Only allow one sync read to happen at a time. +- **PR** `#35406`_: (*rallytime*) Provide links to the renderers in the template docs +- **PR** `#35360`_: (*rallytime*) Add all template registery templates to file.managed docs +- **PR** `#35393`_: (*deniszh*) No need to run ddns update every time +- **PR** `#35407`_: (*hu-dabao*) [Fix-35094] None will not be added to grains which generate [none] +- **PR** `#35411`_: (*eliasp*) modules.event.send(): Prevent backtrace for masterless Minions +- **PR** `#35395`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35394`_: (*rallytime*) Back-port `#34573`_ to 2015.8 +- **PR** `#35359`_: (*terminalmage*) Clean up open filehandles +- **PR** `#35357`_: (*twangboy*) Fix file.recurse with clean: True on Windows (2015.8) +- **PR** `#35339`_: (*isbm*) Bugfix: Prevent continuous restart, if a dependency wasn't installed +- **PR** `#34573`_: (*cedwards*) Update freebsd.rst +- **PR** `#35373`_: (*cachedout*) Raise SaltRenderError on bad requisite +- **PR** `#35352`_: (*twangboy*) Fix file.recurse with clean: True on Windows (2016.3) +- **PR** `#35356`_: (*jfindlay*) document log levels and warn on all logging below info +- **PR** `#35358`_: (*twangboy*) Update libsodium deps +- **PR** `#35360`_: (*rallytime*) Add all template registery templates to file.managed docs +- **PR** `#35362`_: (*rallytime*) Correct deprecation version tags +- **PR** `#35361`_: (*rallytime*) Blockdev deprecations +- **PR** `#25267`_: (*jfindlay*) Disk module improvements +- **PR** `#24893`_: (*The-Loeki*) Contribution: Disk module improvements +- **PR** `#35347`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35325`_: (*kev009*) Fix freebsd netstat route on fbsd 10+ +- **PR** `#35323`_: (*thatch45*) Fix issue with bad error check in salt-vt +- **PR** `#35309`_: (*terminalmage*) file.recurse: Do not convert octal mode string to int +- **PR** `#35301`_: (*bobrik*) Pass port to ssh.check_known_host, closes `#35264`_ +- **PR** `#35334`_: (*cachedout*) Restore random_master functionality +- **PR** `#35331`_: (*hu-dabao*) fix 35165, salt-run jobs.exit_success jid is broken +- **PR** `#35318`_: (*rallytime*) Remove legacy compat docs in mysql pillar since the code was removed already +- **PR** `#30913`_: (*jtand*) Deprecated code removed. +- **PR** `#35329`_: (*hu-dabao*) sys.doc will skip all not connected minions +- **PR** `#35306`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35290`_: (*terminalmage*) Resolve a couple bugs in orchestration output +- **PR** `#35229`_: (*lubyou*) Ignore import error for pwd module in mac_shadow +- **PR** `#35227`_: (*isbm*) Isbm osfinger ubuntu fix +- **PR** `#35286`_: (*hu-dabao*) fix 34425, a bug that sys.doc cannot output format +- **PR** `#35275`_: (*rallytime*) Back-port `#35213`_ to 2016.3 +- **PR** `#35213`_: (*gtmanfred*) add identity v3 support to openstack driver +- **PR** `#35278`_: (*dmurphy18*) Increase timeout for siging to 10 seconds when signing rpm packages +- **PR** `#35276`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35271`_: (*bobrik*) Default state_output_profile to True everywhere, closes `#35166`_ +- **PR** `#35249`_: (*terminalmage*) Fix regression in git.latest +- **PR** `#35245`_: (*rallytime*) Back-port `#35039`_ to 2015.8 +- **PR** `#35241`_: (*terminalmage*) Ensure max recursion in gitfs results in no blob object being returned. +- **PR** `#35240`_: (*derekmaciel*) Backport `#35225`_ to 2015.8 +- **PR** `#35236`_: (*rallytime*) Back-port `#35119`_ to 2015.8 +- **PR** `#35233`_: (*terminalmage*) Do not attempt to get fqdn_ip{4,6} grains when ipv{4,6} grains are empty +- **PR** `#35225`_: (*derekmaciel*) Add missing documentation for pkg.installed +- **PR** `#35211`_: (*cachedout*) Alternative sudo users for salt-ssh +- **PR** `#35202`_: (*multani*) doc: fix broken links in the test documentation page +- **PR** `#35119`_: (*derekmaciel*) Assume two EVRs are equal if E and V are equal but one R is missing. +- **PR** `#35039`_: (*whiteinge*) Add saltenv support to module.run +- **PR** `#35274`_: (*rallytime*) Lint fixes for 2016.3 branch +- **PR** `#35232`_: (*theredcat*) fix rabbitmq version detection using a package-agnostic version +- **PR** `#35269`_: (*meaksh*) Checksum validation for zypper pkg.download in 2016.3 and develop +- **PR** `#35197`_: (*vutny*) Make `pkgbuild.repo` state recognize `createrepo` command return code +- **PR** `#35178`_: (*cro*) Add append_minionid_config_dirs option +- **PR** `#35259`_: (*cachedout*) Fixup 35253 +- **PR** `#35253`_: (*abednarik*) Fix disk.wipe missing option. +- **PR** `#35253`_: (*abednarik*) Fix disk.wipe missing option. +- **PR** `#35206`_: (*hu-dabao*) Make the log level back to warning for unclassified exc +- **PR** `#35196`_: (*isbm*) Deprecate status.uptime one version later +- **PR** `#35207`_: (*eliasp*) Handle exceptions in `_get_virtual()` and in `_get_virtual()` consumers +- **PR** `#35232`_: (*theredcat*) fix rabbitmq version detection using a package-agnostic version +- **PR** `#35244`_: (*rallytime*) Back-port `#31677`_ to 2016.3 +- **PR** `#31677`_: (*miihael*) Return correct value for services that must be enabled in Systemd +- **PR** `#35182`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35174`_: (*rallytime*) Back-port `#35146`_ to 2015.8 +- **PR** `#35173`_: (*rallytime*) Back-port `#35135`_ to 2015.8 +- **PR** `#35146`_: (*cachedout*) Don't discard running beacons config when listing becaons +- **PR** `#35145`_: (*jacobhammons*) doc version update to 2015.8.11, updates to release notes +- **PR** `#35135`_: (*rallytime*) Add missing CLI Examples to aws_sqs module funcs +- **PR** `#34827`_: (*thatch45*) fix beacon list to include all beacons being processed +- **PR** `#35150`_: (*rallytime*) Start release notes for 2016.3.3 +- **PR** `#35157`_: (*hu-dabao*) master returned from func should be a string as designed so far +- **PR** `#35147`_: (*jacobhammons*) doc version updated to 2016.3.2 +- **PR** `#35136`_: (*s0undt3ch*) Don't restart processes if the manager is not set to restart them +- **PR** `#35133`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35114`_: (*terminalmage*) Add clarification docs on a common git_pillar misconfiguration +- **PR** `#35043`_: (*rallytime*) Start release notes file for 2015.8.12 +- **PR** `#34768`_: (*hrumph*) Fixes `#34767`_ +- **PR** `#35120`_: (*kstreee*) The '_handle_event_socket_recv' function in Salt Api is missing first data of stream. +- **PR** `#35131`_: (*rallytime*) Back-port `#35011`_ to 2016.3 +- **PR** `#35011`_: (*nishigori*) Fix docstring for code-block of rst +- **PR** `#35110`_: (*hu-dabao*) Do not return job status back to master for master_alive and master_failback schedules +- **PR** `#35104`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35066`_: (*jfindlay*) returners.postgres_local_cache: do not log in __virtual__ +- **PR** `#35050`_: (*terminalmage*) [orchestration] Properly handle runner/wheel funcs which accept a 'saltdev' argument +- **PR** `#35026`_: (*cachedout*) Expressly deny a minion if a key cannot be found +- **PR** `#35024`_: (*bobrik*) Cache systemd unit update check per unit, closes `#34927`_ +- **PR** `#35105`_: (*rallytime*) Update 2016.3.0 release notes with repo.saltstack.com Xenial pkg availability +- **PR** `#33870`_: (*rallytime*) Add note about Xenial packages to 2016.3.0 release notes +- **PR** `#35059`_: (*vutny*) Add `fun_args` field to events generated by execution of Master modules +- **PR** `#34955`_: (*lubyou*) force dism to always output english text +- **PR** `#35078`_: (*jacobweinstock*) added missing non-keyword argument skip_verify to __get_artifact func… +- **PR** `#35008`_: (*hu-dabao*) Fix multimaster failover on more than two masters and failback behaviour +- **PR** `#35055`_: (*galet*) `#33536`_ pkgrepo.managed does not disable a yum repo with "disabled: True" +- **PR** `#35039`_: (*whiteinge*) Add saltenv support to module.run +- **PR** `#35046`_: (*eliasp*) Prevent backtrace in `salt.states.network` +- **PR** `#35054`_: (*lubyou*) Only fail user lookup is the user parameter is required +- **PR** `#35029`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#35000`_: (*rallytime*) Back-port `#33875`_ and `#34999`_ to 2015.8 +- **PR** `#34994`_: (*rallytime*) Back-port `#34835`_ to 2015.8 +- **PR** `#34835`_: (*thatch45*) Make the mine and publish combine minion and master opts in salt-ssh +- **PR** `#33875`_: (*jmesquita*) Fix naive fileserver map diff algorithm +- **PR** `#35021`_: (*terminalmage*) Don't add '.' to strerror when passed string ends in ? or ! +- **PR** `#34983`_: (*eliasp*) modules.slack.post_message: Allow sending messages to direct-message … +- **PR** `#34996`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#34991`_: (*cachedout*) SSH timeout +- **PR** `#34976`_: (*cachedout*) Refine errors in client +- **PR** `#34831`_: (*thatch45*) If the thin does not match, then redeploy, don't error +- **PR** `#34987`_: (*eliasp*) salt.states.slack: check correct result attribute +- **PR** `#34835`_: (*thatch45*) Make the mine and publish combine minion and master opts in salt-ssh +- **PR** `#34988`_: (*rallytime*) Update release notes with new changes +- **PR** `#34946`_: (*anlutro*) Fix virtualenv behavior when requirements files are in subdirectories +- **PR** `#34957`_: (*sjmh*) Don't fall through to checking auth entries +- **PR** `#34971`_: (*cachedout*) Increase timeout for grains test +- **PR** `#34951`_: (*vutny*) Fix `#34873`_ +- **PR** `#34935`_: (*rallytime*) Avoid UnboundLocalError in beacons module +- **PR** `#34894`_: (*rallytime*) [develop] Merge forward from 2016.3 to develop +- **PR** `#34956`_: (*cachedout*) Increase all run_script timeouts to 30s +- **PR** `#34933`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#34916`_: (*cachedout*) Master performance improvement +- **PR** `#34911`_: (*cachedout*) Backport `#34906`_ +- **PR** `#34906`_: (*cachedout*) Set timeout for run_salt in test suite +- **PR** `#34898`_: (*hrumph*) Stop multiple refreshes during call to pkg.list_upgrades +- **PR** `#34606`_: (*isbm*) Bugfix: Exit on configuration read (backport) +- **PR** `#34915`_: (*abednarik*) Update service_rh provider to exclude XenServer >= 7. +- **PR** `#34926`_: (*rallytime*) Lint `#34923`_ +- **PR** `#34923`_: (*eliasp*) Handle exception when no Slack API key was provided +- **PR** `#34910`_: (*cachedout*) Fix grains error on proxy minions +- **PR** `#34864`_: (*jmacfar*) Check for version in list of installed versions +- **PR** `#34902`_: (*rallytime*) Back-port `#34878`_ to 2016.3 +- **PR** `#34878`_: (*abednarik*) Add VirtuozzoLinux is yumpkg enable list. +- **PR** `#34901`_: (*rallytime*) Add VirtuozzoLinux to the list of enabled distros for rpm.py +- **PR** `#34900`_: (*rallytime*) Add VirtuozzoLinux to enabled platforms list in rh_service.py +- **PR** `#34887`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#34869`_: (*terminalmage*) Fail git.latest states with uncommitted changes when force_reset=False +- **PR** `#34862`_: (*thatch45*) Fix salt-ssh cacheing issue +- **PR** `#34859`_: (*cachedout*) Fix wheel test +- **PR** `#34632`_: (*eliasp*) Try to create the log directory when not present yet +- **PR** `#34854`_: (*rallytime*) Remove string_types import from state compiler +- **PR** `#34865`_: (*thatch45*) This needs discussion, since this breaks SUSE +- **PR** `#34858`_: (*rallytime*) [2016.3] Merge forward from 2015.8 to 2016.3 +- **PR** `#34847`_: (*cachedout*) Add an option to skip the verification of client_acl users +- **PR** `#34833`_: (*rallytime*) Back-port `#28521`_ to 2015.8 +- **PR** `#34828`_: (*thatch45*) Fix `#34648`_ +- **PR** `#34827`_: (*thatch45*) fix beacon list to include all beacons being processed +- **PR** `#34823`_: (*rallytime*) Back-port `#25276`_ to 2015.8 +- **PR** `#34822`_: (*thatch45*) Fix salt-ssh state.high and state.low +- **PR** `#28521`_: (*gongled*) SPM: packaging doesn't work in Python 2.6. Fixed. +- **PR** `#25276`_: (*jacobhammons*) copy spm.1 man page during setup +- **PR** `#34852`_: (*rallytime*) Skip GCE unit tests - causes test suite to hang + +.. _`#18419`: https://github.com/saltstack/salt/issues/18419 +.. _`#24745`: https://github.com/saltstack/salt/issues/24745 +.. _`#24893`: https://github.com/saltstack/salt/pull/24893 +.. _`#25213`: https://github.com/saltstack/salt/issues/25213 +.. _`#25267`: https://github.com/saltstack/salt/pull/25267 +.. _`#25276`: https://github.com/saltstack/salt/pull/25276 +.. _`#26171`: https://github.com/saltstack/salt/issues/26171 +.. _`#27294`: https://github.com/saltstack/salt/issues/27294 +.. _`#27783`: https://github.com/saltstack/salt/issues/27783 +.. _`#28521`: https://github.com/saltstack/salt/pull/28521 +.. _`#29785`: https://github.com/saltstack/salt/issues/29785 +.. _`#30913`: https://github.com/saltstack/salt/pull/30913 +.. _`#31074`: https://github.com/saltstack/salt/issues/31074 +.. _`#31677`: https://github.com/saltstack/salt/pull/31677 +.. _`#32719`: https://github.com/saltstack/salt/issues/32719 +.. _`#32761`: https://github.com/saltstack/salt/issues/32761 +.. _`#33337`: https://github.com/saltstack/salt/pull/33337 +.. _`#33367`: https://github.com/saltstack/salt/issues/33367 +.. _`#33516`: https://github.com/saltstack/salt/issues/33516 +.. _`#33518`: https://github.com/saltstack/salt/pull/33518 +.. _`#33536`: https://github.com/saltstack/salt/issues/33536 +.. _`#33588`: https://github.com/saltstack/salt/issues/33588 +.. _`#33620`: https://github.com/saltstack/salt/issues/33620 +.. _`#33803`: https://github.com/saltstack/salt/issues/33803 +.. _`#33870`: https://github.com/saltstack/salt/pull/33870 +.. _`#33875`: https://github.com/saltstack/salt/pull/33875 +.. _`#34161`: https://github.com/saltstack/salt/issues/34161 +.. _`#34279`: https://github.com/saltstack/salt/issues/34279 +.. _`#34425`: https://github.com/saltstack/salt/issues/34425 +.. _`#34441`: https://github.com/saltstack/salt/pull/34441 +.. _`#34446`: https://github.com/saltstack/salt/issues/34446 +.. _`#34481`: https://github.com/saltstack/salt/issues/34481 +.. _`#34502`: https://github.com/saltstack/salt/pull/34502 +.. _`#34509`: https://github.com/saltstack/salt/issues/34509 +.. _`#34526`: https://github.com/saltstack/salt/issues/34526 +.. _`#34573`: https://github.com/saltstack/salt/pull/34573 +.. _`#34606`: https://github.com/saltstack/salt/pull/34606 +.. _`#34632`: https://github.com/saltstack/salt/pull/34632 +.. _`#34648`: https://github.com/saltstack/salt/issues/34648 +.. _`#34691`: https://github.com/saltstack/salt/issues/34691 +.. _`#34702`: https://github.com/saltstack/salt/pull/34702 +.. _`#34725`: https://github.com/saltstack/salt/issues/34725 +.. _`#34760`: https://github.com/saltstack/salt/issues/34760 +.. _`#34767`: https://github.com/saltstack/salt/issues/34767 +.. _`#34768`: https://github.com/saltstack/salt/pull/34768 +.. _`#34796`: https://github.com/saltstack/salt/issues/34796 +.. _`#34798`: https://github.com/saltstack/salt/issues/34798 +.. _`#34806`: https://github.com/saltstack/salt/issues/34806 +.. _`#34816`: https://github.com/saltstack/salt/issues/34816 +.. _`#34822`: https://github.com/saltstack/salt/pull/34822 +.. _`#34823`: https://github.com/saltstack/salt/pull/34823 +.. _`#34827`: https://github.com/saltstack/salt/pull/34827 +.. _`#34828`: https://github.com/saltstack/salt/pull/34828 +.. _`#34831`: https://github.com/saltstack/salt/pull/34831 +.. _`#34833`: https://github.com/saltstack/salt/pull/34833 +.. _`#34835`: https://github.com/saltstack/salt/pull/34835 +.. _`#34847`: https://github.com/saltstack/salt/pull/34847 +.. _`#34852`: https://github.com/saltstack/salt/pull/34852 +.. _`#34854`: https://github.com/saltstack/salt/pull/34854 +.. _`#34858`: https://github.com/saltstack/salt/pull/34858 +.. _`#34859`: https://github.com/saltstack/salt/pull/34859 +.. _`#34861`: https://github.com/saltstack/salt/issues/34861 +.. _`#34862`: https://github.com/saltstack/salt/pull/34862 +.. _`#34864`: https://github.com/saltstack/salt/pull/34864 +.. _`#34865`: https://github.com/saltstack/salt/pull/34865 +.. _`#34869`: https://github.com/saltstack/salt/pull/34869 +.. _`#34873`: https://github.com/saltstack/salt/issues/34873 +.. _`#34878`: https://github.com/saltstack/salt/pull/34878 +.. _`#34887`: https://github.com/saltstack/salt/pull/34887 +.. _`#34890`: https://github.com/saltstack/salt/issues/34890 +.. _`#34893`: https://github.com/saltstack/salt/issues/34893 +.. _`#34894`: https://github.com/saltstack/salt/pull/34894 +.. _`#34898`: https://github.com/saltstack/salt/pull/34898 +.. _`#34900`: https://github.com/saltstack/salt/pull/34900 +.. _`#34901`: https://github.com/saltstack/salt/pull/34901 +.. _`#34902`: https://github.com/saltstack/salt/pull/34902 +.. _`#34906`: https://github.com/saltstack/salt/pull/34906 +.. _`#34908`: https://github.com/saltstack/salt/issues/34908 +.. _`#34910`: https://github.com/saltstack/salt/pull/34910 +.. _`#34911`: https://github.com/saltstack/salt/pull/34911 +.. _`#34915`: https://github.com/saltstack/salt/pull/34915 +.. _`#34916`: https://github.com/saltstack/salt/pull/34916 +.. _`#34923`: https://github.com/saltstack/salt/pull/34923 +.. _`#34926`: https://github.com/saltstack/salt/pull/34926 +.. _`#34927`: https://github.com/saltstack/salt/issues/34927 +.. _`#34933`: https://github.com/saltstack/salt/pull/34933 +.. _`#34935`: https://github.com/saltstack/salt/pull/34935 +.. _`#34945`: https://github.com/saltstack/salt/issues/34945 +.. _`#34946`: https://github.com/saltstack/salt/pull/34946 +.. _`#34951`: https://github.com/saltstack/salt/pull/34951 +.. _`#34955`: https://github.com/saltstack/salt/pull/34955 +.. _`#34956`: https://github.com/saltstack/salt/pull/34956 +.. _`#34957`: https://github.com/saltstack/salt/pull/34957 +.. _`#34971`: https://github.com/saltstack/salt/pull/34971 +.. _`#34976`: https://github.com/saltstack/salt/pull/34976 +.. _`#34983`: https://github.com/saltstack/salt/pull/34983 +.. _`#34987`: https://github.com/saltstack/salt/pull/34987 +.. _`#34988`: https://github.com/saltstack/salt/pull/34988 +.. _`#34991`: https://github.com/saltstack/salt/pull/34991 +.. _`#34994`: https://github.com/saltstack/salt/pull/34994 +.. _`#34996`: https://github.com/saltstack/salt/pull/34996 +.. _`#34999`: https://github.com/saltstack/salt/issues/34999 +.. _`#35000`: https://github.com/saltstack/salt/pull/35000 +.. _`#35003`: https://github.com/saltstack/salt/issues/35003 +.. _`#35008`: https://github.com/saltstack/salt/pull/35008 +.. _`#35010`: https://github.com/saltstack/salt/issues/35010 +.. _`#35011`: https://github.com/saltstack/salt/pull/35011 +.. _`#35021`: https://github.com/saltstack/salt/pull/35021 +.. _`#35024`: https://github.com/saltstack/salt/pull/35024 +.. _`#35026`: https://github.com/saltstack/salt/pull/35026 +.. _`#35029`: https://github.com/saltstack/salt/pull/35029 +.. _`#35039`: https://github.com/saltstack/salt/pull/35039 +.. _`#35043`: https://github.com/saltstack/salt/pull/35043 +.. _`#35046`: https://github.com/saltstack/salt/pull/35046 +.. _`#35050`: https://github.com/saltstack/salt/pull/35050 +.. _`#35051`: https://github.com/saltstack/salt/issues/35051 +.. _`#35054`: https://github.com/saltstack/salt/pull/35054 +.. _`#35055`: https://github.com/saltstack/salt/pull/35055 +.. _`#35059`: https://github.com/saltstack/salt/pull/35059 +.. _`#35066`: https://github.com/saltstack/salt/pull/35066 +.. _`#35078`: https://github.com/saltstack/salt/pull/35078 +.. _`#35094`: https://github.com/saltstack/salt/issues/35094 +.. _`#35102`: https://github.com/saltstack/salt/issues/35102 +.. _`#35104`: https://github.com/saltstack/salt/pull/35104 +.. _`#35105`: https://github.com/saltstack/salt/pull/35105 +.. _`#35110`: https://github.com/saltstack/salt/pull/35110 +.. _`#35114`: https://github.com/saltstack/salt/pull/35114 +.. _`#35119`: https://github.com/saltstack/salt/pull/35119 +.. _`#35120`: https://github.com/saltstack/salt/pull/35120 +.. _`#35121`: https://github.com/saltstack/salt/issues/35121 +.. _`#35131`: https://github.com/saltstack/salt/pull/35131 +.. _`#35132`: https://github.com/saltstack/salt/pull/35132 +.. _`#35133`: https://github.com/saltstack/salt/pull/35133 +.. _`#35135`: https://github.com/saltstack/salt/pull/35135 +.. _`#35136`: https://github.com/saltstack/salt/pull/35136 +.. _`#35145`: https://github.com/saltstack/salt/pull/35145 +.. _`#35146`: https://github.com/saltstack/salt/pull/35146 +.. _`#35147`: https://github.com/saltstack/salt/pull/35147 +.. _`#35150`: https://github.com/saltstack/salt/pull/35150 +.. _`#35157`: https://github.com/saltstack/salt/pull/35157 +.. _`#35165`: https://github.com/saltstack/salt/issues/35165 +.. _`#35166`: https://github.com/saltstack/salt/issues/35166 +.. _`#35173`: https://github.com/saltstack/salt/pull/35173 +.. _`#35174`: https://github.com/saltstack/salt/pull/35174 +.. _`#35178`: https://github.com/saltstack/salt/pull/35178 +.. _`#35182`: https://github.com/saltstack/salt/pull/35182 +.. _`#35196`: https://github.com/saltstack/salt/pull/35196 +.. _`#35197`: https://github.com/saltstack/salt/pull/35197 +.. _`#35202`: https://github.com/saltstack/salt/pull/35202 +.. _`#35206`: https://github.com/saltstack/salt/pull/35206 +.. _`#35207`: https://github.com/saltstack/salt/pull/35207 +.. _`#35211`: https://github.com/saltstack/salt/pull/35211 +.. _`#35213`: https://github.com/saltstack/salt/pull/35213 +.. _`#35214`: https://github.com/saltstack/salt/issues/35214 +.. _`#35225`: https://github.com/saltstack/salt/pull/35225 +.. _`#35226`: https://github.com/saltstack/salt/issues/35226 +.. _`#35227`: https://github.com/saltstack/salt/pull/35227 +.. _`#35229`: https://github.com/saltstack/salt/pull/35229 +.. _`#35232`: https://github.com/saltstack/salt/pull/35232 +.. _`#35233`: https://github.com/saltstack/salt/pull/35233 +.. _`#35234`: https://github.com/saltstack/salt/issues/35234 +.. _`#35235`: https://github.com/saltstack/salt/pull/35235 +.. _`#35236`: https://github.com/saltstack/salt/pull/35236 +.. _`#35240`: https://github.com/saltstack/salt/pull/35240 +.. _`#35241`: https://github.com/saltstack/salt/pull/35241 +.. _`#35244`: https://github.com/saltstack/salt/pull/35244 +.. _`#35245`: https://github.com/saltstack/salt/pull/35245 +.. _`#35249`: https://github.com/saltstack/salt/pull/35249 +.. _`#35253`: https://github.com/saltstack/salt/pull/35253 +.. _`#35259`: https://github.com/saltstack/salt/pull/35259 +.. _`#35264`: https://github.com/saltstack/salt/issues/35264 +.. _`#35269`: https://github.com/saltstack/salt/pull/35269 +.. _`#35271`: https://github.com/saltstack/salt/pull/35271 +.. _`#35274`: https://github.com/saltstack/salt/pull/35274 +.. _`#35275`: https://github.com/saltstack/salt/pull/35275 +.. _`#35276`: https://github.com/saltstack/salt/pull/35276 +.. _`#35278`: https://github.com/saltstack/salt/pull/35278 +.. _`#35286`: https://github.com/saltstack/salt/pull/35286 +.. _`#35290`: https://github.com/saltstack/salt/pull/35290 +.. _`#35296`: https://github.com/saltstack/salt/issues/35296 +.. _`#35301`: https://github.com/saltstack/salt/pull/35301 +.. _`#35302`: https://github.com/saltstack/salt/pull/35302 +.. _`#35306`: https://github.com/saltstack/salt/pull/35306 +.. _`#35308`: https://github.com/saltstack/salt/pull/35308 +.. _`#35309`: https://github.com/saltstack/salt/pull/35309 +.. _`#35318`: https://github.com/saltstack/salt/pull/35318 +.. _`#35323`: https://github.com/saltstack/salt/pull/35323 +.. _`#35325`: https://github.com/saltstack/salt/pull/35325 +.. _`#35329`: https://github.com/saltstack/salt/pull/35329 +.. _`#35331`: https://github.com/saltstack/salt/pull/35331 +.. _`#35334`: https://github.com/saltstack/salt/pull/35334 +.. _`#35336`: https://github.com/saltstack/salt/issues/35336 +.. _`#35339`: https://github.com/saltstack/salt/pull/35339 +.. _`#35347`: https://github.com/saltstack/salt/pull/35347 +.. _`#35352`: https://github.com/saltstack/salt/pull/35352 +.. _`#35356`: https://github.com/saltstack/salt/pull/35356 +.. _`#35357`: https://github.com/saltstack/salt/pull/35357 +.. _`#35358`: https://github.com/saltstack/salt/pull/35358 +.. _`#35359`: https://github.com/saltstack/salt/pull/35359 +.. _`#35360`: https://github.com/saltstack/salt/pull/35360 +.. _`#35361`: https://github.com/saltstack/salt/pull/35361 +.. _`#35362`: https://github.com/saltstack/salt/pull/35362 +.. _`#35373`: https://github.com/saltstack/salt/pull/35373 +.. _`#35380`: https://github.com/saltstack/salt/issues/35380 +.. _`#35384`: https://github.com/saltstack/salt/issues/35384 +.. _`#35387`: https://github.com/saltstack/salt/issues/35387 +.. _`#35393`: https://github.com/saltstack/salt/pull/35393 +.. _`#35394`: https://github.com/saltstack/salt/pull/35394 +.. _`#35395`: https://github.com/saltstack/salt/pull/35395 +.. _`#35403`: https://github.com/saltstack/salt/issues/35403 +.. _`#35406`: https://github.com/saltstack/salt/pull/35406 +.. _`#35407`: https://github.com/saltstack/salt/pull/35407 +.. _`#35411`: https://github.com/saltstack/salt/pull/35411 +.. _`#35412`: https://github.com/saltstack/salt/pull/35412 +.. _`#35413`: https://github.com/saltstack/salt/pull/35413 +.. _`#35420`: https://github.com/saltstack/salt/issues/35420 +.. _`#35422`: https://github.com/saltstack/salt/issues/35422 +.. _`#35423`: https://github.com/saltstack/salt/issues/35423 +.. _`#35427`: https://github.com/saltstack/salt/pull/35427 +.. _`#35428`: https://github.com/saltstack/salt/pull/35428 +.. _`#35429`: https://github.com/saltstack/salt/pull/35429 +.. _`#35436`: https://github.com/saltstack/salt/pull/35436 +.. _`#35442`: https://github.com/saltstack/salt/pull/35442 +.. _`#35446`: https://github.com/saltstack/salt/pull/35446 +.. _`#35447`: https://github.com/saltstack/salt/pull/35447 +.. _`#35448`: https://github.com/saltstack/salt/pull/35448 +.. _`#35449`: https://github.com/saltstack/salt/pull/35449 +.. _`#35451`: https://github.com/saltstack/salt/pull/35451 +.. _`#35453`: https://github.com/saltstack/salt/pull/35453 +.. _`#35456`: https://github.com/saltstack/salt/pull/35456 +.. _`#35458`: https://github.com/saltstack/salt/issues/35458 +.. _`#35459`: https://github.com/saltstack/salt/pull/35459 +.. _`#35460`: https://github.com/saltstack/salt/pull/35460 +.. _`#35461`: https://github.com/saltstack/salt/pull/35461 +.. _`#35463`: https://github.com/saltstack/salt/pull/35463 +.. _`#35467`: https://github.com/saltstack/salt/pull/35467 +.. _`#35471`: https://github.com/saltstack/salt/pull/35471 +.. _`#35476`: https://github.com/saltstack/salt/pull/35476 +.. _`#35483`: https://github.com/saltstack/salt/pull/35483 +.. _`#35486`: https://github.com/saltstack/salt/pull/35486 +.. _`#35487`: https://github.com/saltstack/salt/pull/35487 +.. _`#35489`: https://github.com/saltstack/salt/pull/35489 +.. _`#35492`: https://github.com/saltstack/salt/pull/35492 +.. _`#35495`: https://github.com/saltstack/salt/pull/35495 +.. _`#35497`: https://github.com/saltstack/salt/pull/35497 +.. _`#35498`: https://github.com/saltstack/salt/pull/35498 +.. _`#35508`: https://github.com/saltstack/salt/pull/35508 +.. _`#35510`: https://github.com/saltstack/salt/pull/35510 +.. _`#35512`: https://github.com/saltstack/salt/pull/35512 +.. _`#35513`: https://github.com/saltstack/salt/pull/35513 +.. _`#35516`: https://github.com/saltstack/salt/pull/35516 +.. _`#35517`: https://github.com/saltstack/salt/pull/35517 +.. _`#35522`: https://github.com/saltstack/salt/pull/35522 +.. _`#35525`: https://github.com/saltstack/salt/pull/35525 +.. _`#35526`: https://github.com/saltstack/salt/pull/35526 +.. _`#35538`: https://github.com/saltstack/salt/pull/35538 +.. _`#35540`: https://github.com/saltstack/salt/pull/35540 +.. _`#35545`: https://github.com/saltstack/salt/pull/35545 +.. _`#35546`: https://github.com/saltstack/salt/pull/35546 +.. _`#35566`: https://github.com/saltstack/salt/pull/35566 +.. _`#35571`: https://github.com/saltstack/salt/pull/35571 +.. _`#35572`: https://github.com/saltstack/salt/pull/35572 +.. _`#35573`: https://github.com/saltstack/salt/pull/35573 +.. _`#35577`: https://github.com/saltstack/salt/pull/35577 +.. _`#35579`: https://github.com/saltstack/salt/pull/35579 +.. _`#35580`: https://github.com/saltstack/salt/pull/35580 +.. _`#35583`: https://github.com/saltstack/salt/pull/35583 +.. _`#35586`: https://github.com/saltstack/salt/pull/35586 +.. _`bp-25276`: https://github.com/saltstack/salt/pull/25276 +.. _`bp-28521`: https://github.com/saltstack/salt/pull/28521 +.. _`bp-31677`: https://github.com/saltstack/salt/pull/31677 +.. _`bp-33518`: https://github.com/saltstack/salt/pull/33518 +.. _`bp-33875`: https://github.com/saltstack/salt/pull/33875 +.. _`bp-34441`: https://github.com/saltstack/salt/pull/34441 +.. _`bp-34502`: https://github.com/saltstack/salt/pull/34502 +.. _`bp-34835`: https://github.com/saltstack/salt/pull/34835 +.. _`bp-35039`: https://github.com/saltstack/salt/pull/35039 +.. _`bp-35119`: https://github.com/saltstack/salt/pull/35119 +.. _`bp-35213`: https://github.com/saltstack/salt/pull/35213 +.. _`bp-35225`: https://github.com/saltstack/salt/pull/35225 +.. _`bp-35463`: https://github.com/saltstack/salt/pull/35463 +.. _`fix-34425`: https://github.com/saltstack/salt/issues/34425 +.. _`fix-34890`: https://github.com/saltstack/salt/issues/34890 +.. _`fix-34893`: https://github.com/saltstack/salt/issues/34893 +.. _`fix-35094`: https://github.com/saltstack/salt/issues/35094 +.. _`fix-35165`: https://github.com/saltstack/salt/issues/35165 +.. _`fix-35336`: https://github.com/saltstack/salt/issues/35336 +.. _`fix-35384`: https://github.com/saltstack/salt/issues/35384 +.. _`fix-35420`: https://github.com/saltstack/salt/issues/35420 +.. _`fix-35422`: https://github.com/saltstack/salt/issues/35422 +.. _`fix-35458`: https://github.com/saltstack/salt/issues/35458 From 21c9c2d025b58ae32a859c3c99b453f8420afe1c Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 10:29:58 -0600 Subject: [PATCH 25/35] Make sure version label is correct in header (#35603) --- doc/topics/releases/2016.3.3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/topics/releases/2016.3.3.rst b/doc/topics/releases/2016.3.3.rst index 87ad973d2c..f53015c4ae 100644 --- a/doc/topics/releases/2016.3.3.rst +++ b/doc/topics/releases/2016.3.3.rst @@ -6,8 +6,8 @@ Version 2016.3.3 is a bugfix release for :doc:`2016.3.0 `. -Changes for v2016.3.2..2016.3 ------------------------------ +Changes for v2016.3.2..2016.3.3 +------------------------------- Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs): From 36d8b4a40906e6eeab6a45f3fe2eaa63bacb827b Mon Sep 17 00:00:00 2001 From: abednarik Date: Wed, 20 Apr 2016 22:32:20 -0300 Subject: [PATCH 26/35] Rsync synchronized updates. Aadded --dry-run option which is also used for test mode taking adventage of this option in rsync. Update state documentation to follow Salt standards Finally synchronized was not working, See #32478. Changes cmd.run to cmd.run_all make this works. Tests updated --- salt/modules/rsync.py | 14 ++++-- salt/states/rsync.py | 77 ++++++++++++++++++++++---------- tests/unit/modules/rsync_test.py | 2 +- 3 files changed, 64 insertions(+), 29 deletions(-) diff --git a/salt/modules/rsync.py b/salt/modules/rsync.py index 402d8f10dc..b440fe3dc3 100644 --- a/salt/modules/rsync.py +++ b/salt/modules/rsync.py @@ -20,7 +20,7 @@ from salt.exceptions import CommandExecutionError, SaltInvocationError log = logging.getLogger(__name__) -def _check(delete, force, update, passwordfile, exclude, excludefrom): +def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun): ''' Generate rsync options ''' @@ -40,6 +40,8 @@ def _check(delete, force, update, passwordfile, exclude, excludefrom): exclude = False if exclude: options.extend(['--exclude', exclude]) + if dryrun: + options.append('--dry-run') return options @@ -50,7 +52,8 @@ def rsync(src, update=False, passwordfile=None, exclude=None, - excludefrom=None): + excludefrom=None, + dryrun=False): ''' .. versionchanged:: 2016.3.0 Return data now contains just the output of the rsync command, instead @@ -82,13 +85,16 @@ def rsync(src, exclude = __salt__['config.option']('rsync.exclude') if not excludefrom: excludefrom = __salt__['config.option']('rsync.excludefrom') + if not dryrun: + dryrun = __salt__['config.option']('rsync.dryrun') if not src or not dst: raise SaltInvocationError('src and dst cannot be empty') - option = _check(delete, force, update, passwordfile, exclude, excludefrom) + option = _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun) cmd = ['rsync'] + option + [src, dst] + log.debug('Running rsync command: {0}'.format(cmd)) try: - return __salt__['cmd.run'](cmd, python_shell=False) + return __salt__['cmd.run_all'](cmd, python_shell=False) except (IOError, OSError) as exc: raise CommandExecutionError(exc.strerror) diff --git a/salt/states/rsync.py b/salt/states/rsync.py index bda65aa2eb..7485da87ae 100644 --- a/salt/states/rsync.py +++ b/salt/states/rsync.py @@ -14,9 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' -Rsync state. +State to synchronize files and directories with rsync. .. versionadded:: 2016.3.0 + +.. code-block:: yaml + + /opt/user-backups: + rsync.synchronized: + - source: /home + - force: True + ''' from __future__ import absolute_import @@ -36,9 +44,6 @@ def __virtual__(): def _get_summary(rsync_out): ''' Get summary from the rsync successfull output. - - :param rsync_out: - :return: ''' return "- " + "\n- ".join([elm for elm in rsync_out.split("\n\n")[-1].replace(" ", "\n").split("\n") if elm]) @@ -47,9 +52,6 @@ def _get_summary(rsync_out): def _get_changes(rsync_out): ''' Get changes from the rsync successfull output. - - :param rsync_out: - :return: ''' copied = list() deleted = list() @@ -73,28 +75,45 @@ def synchronized(name, source, passwordfile=None, exclude=None, excludefrom=None, - prepare=False): + prepare=False, + dryrun=False): ''' Guarantees that the source directory is always copied to the target. - :param name: Name of the target directory. - :param source: Source directory. - :param prepare: Create destination directory if it does not exists. - :param delete: Delete extraneous files from the destination dirs (True or False) - :param force: Force deletion of dirs even if not empty - :param update: Skip files that are newer on the receiver (True or False) - :param passwordfile: Read daemon-access password from the file (path) - :param exclude: Exclude files, that matches pattern. - :param excludefrom: Read exclude patterns from the file (path) - :return: + name + Name of the target directory. - .. code-block:: yaml + source + Source directory. - /opt/user-backups: - rsync.synchronized: - - source: /home - - force: True + prepare + Create destination directory if it does not exists. + + delete + Delete extraneous files from the destination dirs (True or False) + + force + Force deletion of dirs even if not empty + + update + Skip files that are newer on the receiver (True or False) + + passwordfile + Read daemon-access password from the file (path) + + exclude + Exclude files, that matches pattern. + + excludefrom + Read exclude patterns from the file (path) + + dryrun + Perform a trial run with no changes made. Is the same as + doing test=True + + .. versionadded:: 2016.3.1 ''' + ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} if not os.path.exists(source): @@ -107,8 +126,18 @@ def synchronized(name, source, if not os.path.exists(name) and prepare: os.makedirs(name) + if __opts__['test']: + dryrun = True + result = __salt__['rsync.rsync'](source, name, delete=delete, force=force, update=update, - passwordfile=passwordfile, exclude=exclude, excludefrom=excludefrom) + passwordfile=passwordfile, exclude=exclude, excludefrom=excludefrom, + dryrun=dryrun) + + if __opts__['test'] or dryrun: + ret['result'] = None + ret['comment'] = _get_summary(result['stdout']) + return ret + if result.get('retcode'): ret['result'] = False ret['comment'] = result['stderr'] diff --git a/tests/unit/modules/rsync_test.py b/tests/unit/modules/rsync_test.py index 936d859cba..8ef652f04f 100644 --- a/tests/unit/modules/rsync_test.py +++ b/tests/unit/modules/rsync_test.py @@ -40,7 +40,7 @@ class RsyncTestCase(TestCase): with patch.dict(rsync.__salt__, {'config.option': MagicMock(return_value='A'), - 'cmd.run': MagicMock(side_effect=[IOError('f'), + 'cmd.run_all': MagicMock(side_effect=[IOError('f'), 'A'])}): with patch.object(rsync, '_check', return_value=['A']): self.assertRaises(CommandExecutionError, rsync.rsync, 'a', 'b') From f7f8221169614c58e1420b088f88e87664674e6a Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 16:05:40 -0600 Subject: [PATCH 27/35] Everything in the sample master config file should be commented out (#35611) --- conf/master | 2 +- doc/ref/configuration/master.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/master b/conf/master index 55e1983ba8..e001390ac4 100644 --- a/conf/master +++ b/conf/master @@ -86,7 +86,7 @@ # Set the default output file used by the salt command. Default is to output # to the CLI and not to a file. Functions the same way as the "--out-file" -CLI option, only sets this to a single file for all salt commands. +# CLI option, only sets this to a single file for all salt commands. #output_file: None # Return minions that timeout when running commands like test.ping diff --git a/doc/ref/configuration/master.rst b/doc/ref/configuration/master.rst index d49156ae4a..f181a661f0 100644 --- a/doc/ref/configuration/master.rst +++ b/doc/ref/configuration/master.rst @@ -346,8 +346,8 @@ Set the default outputter used by the salt command. Default: None -# Set the default output file used by the salt command. Default is to output -# to the CLI and not to a file. Functions the same way as the "--out-file" +Set the default output file used by the salt command. Default is to output +to the CLI and not to a file. Functions the same way as the "--out-file" CLI option, only sets this to a single file for all salt commands. .. code-block:: yaml From 399e9f57cc9611d385ddf86a0792b9f16dd95f75 Mon Sep 17 00:00:00 2001 From: Nicole Thomas Date: Fri, 19 Aug 2016 16:13:08 -0600 Subject: [PATCH 28/35] Update release notes for 2015.8.12 (#35614) --- doc/topics/releases/2015.8.12.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/topics/releases/2015.8.12.rst b/doc/topics/releases/2015.8.12.rst index 11673aff24..99eb6af141 100644 --- a/doc/topics/releases/2015.8.12.rst +++ b/doc/topics/releases/2015.8.12.rst @@ -17,6 +17,9 @@ Total Merges: **57** Changes: +- **PR** `#35611`_: (rallytime*) Everything in the sample master config file should be commented out +- **PR** `#35569`_: (*rallytime) Write test for multiple unless commands where 1st cmd passes and 2nd fails +- **PR** `#35600`_: (*rallytime) Update release notes for 2015.8.12 - **PR** `#35599`_: (*rallytime*) Update release notes for 2015.8.12 - **PR** `#35584`_: (*terminalmage*) Update linux_sysctl tests to reflect new context key - **PR** `#35575`_: (*terminalmage*) Add warning about AWS flagging of nmap usage @@ -248,10 +251,13 @@ Changes: .. _`#35545`: https://github.com/saltstack/salt/pull/35545 .. _`#35546`: https://github.com/saltstack/salt/pull/35546 .. _`#35566`: https://github.com/saltstack/salt/pull/35566 +.. _`#35569`: https://github.com/saltstack/salt/pull/35569 .. _`#35575`: https://github.com/saltstack/salt/pull/35575 .. _`#35577`: https://github.com/saltstack/salt/pull/35577 .. _`#35584`: https://github.com/saltstack/salt/pull/35584 .. _`#35599`: https://github.com/saltstack/salt/pull/35599 +.. _`#35600`: https://github.com/saltstack/salt/pull/35600 +.. _`#35611`: https://github.com/saltstack/salt/pull/35611 .. _`bp-25276`: https://github.com/saltstack/salt/pull/25276 .. _`bp-28521`: https://github.com/saltstack/salt/pull/28521 .. _`bp-33875`: https://github.com/saltstack/salt/pull/33875 From 69a2427670b3ecd690da475bcd58d007ad2da15c Mon Sep 17 00:00:00 2001 From: Hengyang Hu Date: Fri, 19 Aug 2016 16:52:44 -0700 Subject: [PATCH 29/35] fix 35591, verify the acl file exist before proceed --- salt/states/linux_acl.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/salt/states/linux_acl.py b/salt/states/linux_acl.py index 07e4ee67b3..274b84db1a 100644 --- a/salt/states/linux_acl.py +++ b/salt/states/linux_acl.py @@ -25,6 +25,9 @@ Ensure a Linux ACL does not exist - perms: rwx ''' +# Import python libs +import os + # Import Python libs from __future__ import absolute_import @@ -58,6 +61,11 @@ def present(name, acl_type, acl_name='', perms='', recurse=False): _octal = {'r': 4, 'w': 2, 'x': 1, '-': 0} + if not os.path.isfile(name): + ret['comment'] = '{0} does not exist'.format(name) + ret['result'] = False + return ret + __current_perms = __salt__['acl.getfacl'](name) if acl_type.startswith(('d:', 'default:')): @@ -97,10 +105,7 @@ def present(name, acl_type, acl_name='', perms='', recurse=False): ret['result'] = None return ret - if recurse: - __salt__['acl.modfacl'](acl_type, acl_name, perms, name, recursive=True) - else: - __salt__['acl.modfacl'](acl_type, acl_name, perms, name) + __salt__['acl.modfacl'](acl_type, acl_name, perms, name, recursive=recurse) else: ret['comment'] = 'Permissions will be applied' @@ -108,10 +113,7 @@ def present(name, acl_type, acl_name='', perms='', recurse=False): ret['result'] = None return ret - if recurse: - __salt__['acl.modfacl'](acl_type, acl_name, perms, name, recursive=True) - else: - __salt__['acl.modfacl'](acl_type, acl_name, perms, name) + __salt__['acl.modfacl'](acl_type, acl_name, perms, name, recursive=recurse) else: ret['comment'] = 'ACL Type does not exist' ret['result'] = False @@ -128,6 +130,11 @@ def absent(name, acl_type, acl_name='', perms='', recurse=False): 'changes': {}, 'comment': ''} + if not os.path.isfile(name): + ret['comment'] = '{0} does not exist'.format(name) + ret['result'] = False + return ret + __current_perms = __salt__['acl.getfacl'](name) if acl_type.startswith(('d:', 'default:')): @@ -164,10 +171,7 @@ def absent(name, acl_type, acl_name='', perms='', recurse=False): ret['result'] = None return ret - if recurse: - __salt__['acl.delfacl'](acl_type, acl_name, perms, name, recursive=True) - else: - __salt__['acl.delfacl'](acl_type, acl_name, perms, name) + __salt__['acl.delfacl'](acl_type, acl_name, perms, name, recursive=recurse) else: ret['comment'] = 'Permissions are in the desired state' From 2801f0fdccd26d2090fb8546590ca6744c5b1f46 Mon Sep 17 00:00:00 2001 From: Brian Glogower Date: Fri, 19 Aug 2016 17:42:33 -0700 Subject: [PATCH 30/35] Remove duplicate auth_tries in minion docs --- doc/ref/configuration/minion.rst | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 35f1e6a1f4..68122d310b 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -673,23 +673,6 @@ parameter. The wait-time will be a random number of seconds between random_reauth_delay: 60 -.. conf_minion:: auth_tries - -``auth_tries`` --------------- - -.. versionadded:: 2014.7.0 - -Default: ``7`` - -The number of attempts to authenticate to a master before giving up. Or, more -technically, the number of consecutive SaltReqTimeoutErrors that are acceptable -when trying to authenticate to the master. - -.. code-block:: yaml - - auth_tries: 7 - .. conf_minion:: master_tries ``master_tries`` From 7355eb4ecde10710a104100d549213b7ac0b47c1 Mon Sep 17 00:00:00 2001 From: Hengyang Hu Date: Fri, 19 Aug 2016 19:59:36 -0700 Subject: [PATCH 31/35] move python lib import after absolute_import --- salt/states/linux_acl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/states/linux_acl.py b/salt/states/linux_acl.py index 274b84db1a..72945f7043 100644 --- a/salt/states/linux_acl.py +++ b/salt/states/linux_acl.py @@ -25,12 +25,12 @@ Ensure a Linux ACL does not exist - perms: rwx ''' -# Import python libs -import os - # Import Python libs from __future__ import absolute_import +# Import python libs +import os + # Import salt libs import salt.utils From 402b83e4d3085092a196d6d1b249d9ed01c34fbe Mon Sep 17 00:00:00 2001 From: Hengyang Hu Date: Sat, 20 Aug 2016 12:13:08 -0700 Subject: [PATCH 32/35] change file verification to exist --- salt/states/linux_acl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/states/linux_acl.py b/salt/states/linux_acl.py index 72945f7043..a6a54a7fcd 100644 --- a/salt/states/linux_acl.py +++ b/salt/states/linux_acl.py @@ -61,7 +61,7 @@ def present(name, acl_type, acl_name='', perms='', recurse=False): _octal = {'r': 4, 'w': 2, 'x': 1, '-': 0} - if not os.path.isfile(name): + if not os.path.exists(name): ret['comment'] = '{0} does not exist'.format(name) ret['result'] = False return ret @@ -130,7 +130,7 @@ def absent(name, acl_type, acl_name='', perms='', recurse=False): 'changes': {}, 'comment': ''} - if not os.path.isfile(name): + if not os.path.exists(name): ret['comment'] = '{0} does not exist'.format(name) ret['result'] = False return ret From fe338ff41f35f274cd2fb9410e4b1816775cede0 Mon Sep 17 00:00:00 2001 From: Hengyang Hu Date: Sun, 21 Aug 2016 19:03:37 -0700 Subject: [PATCH 33/35] fix 34922, StopIteration should not throw exception out --- salt/cli/batch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/salt/cli/batch.py b/salt/cli/batch.py index 902b293a19..528d25fa01 100644 --- a/salt/cli/batch.py +++ b/salt/cli/batch.py @@ -53,15 +53,17 @@ class Batch(object): ping_gen = self.local.cmd_iter(*args, **self.eauth) + # Broadcast to targets fret = set() try: for ret in ping_gen: m = next(six.iterkeys(ret)) if m is not None: fret.add(m) - return (list(fret), ping_gen) except StopIteration: - raise salt.exceptions.SaltClientError('No minions matched the target.') + if not self.quiet: + print_cli('No minions matched the target.') + return list(fret), ping_gen def get_bnum(self): ''' @@ -101,6 +103,9 @@ class Batch(object): 'list', ] bnum = self.get_bnum() + # No targets to run + if not self.minions: + return to_run = copy.deepcopy(self.minions) active = [] ret = {} From 64974c89d91402eacbc708eff4da774c822891f4 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Mon, 22 Aug 2016 13:03:24 -0600 Subject: [PATCH 34/35] Backport #35627 to 2016.3 (#35661) * This test was doing all sorts of things, raging from simply failing to driving CPUs to 100%, to leaking memory until the entire test suite crashes. This seems to happen only in conjunction with running the entire unit test suite and does not occur on its own cc: @kraney * Better method to skip test. This way we can track it. --- tests/unit/modules/boto_lambda_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/modules/boto_lambda_test.py b/tests/unit/modules/boto_lambda_test.py index 01ca2455e1..ec6d6d2ca3 100644 --- a/tests/unit/modules/boto_lambda_test.py +++ b/tests/unit/modules/boto_lambda_test.py @@ -626,7 +626,7 @@ class BotoLambdaEventSourceMappingTestCase(BotoLambdaTestCaseBase, BotoLambdaTes **conn_parameters) self.assertTrue(result['deleted']) - @skipIf(ON_SUSE, 'Skipping while debugging why the test suite hangs and bails on this test on opensuse') + @skipIf(True, 'This appears to leak memory and crash the unit test suite') def test_that_when_deleting_an_event_source_mapping_by_name_succeeds_the_delete_event_source_mapping_method_returns_true(self): ''' tests True mapping deleted. From 3d6d473d48a520840ff7a1858d60c94b48cb9329 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 22 Aug 2016 17:57:14 -0600 Subject: [PATCH 35/35] Revert to vcredist 12 (2013) --- pkg/windows/modules/get-settings.psm1 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/windows/modules/get-settings.psm1 b/pkg/windows/modules/get-settings.psm1 index 379719bbee..dee25e15e6 100644 --- a/pkg/windows/modules/get-settings.psm1 +++ b/pkg/windows/modules/get-settings.psm1 @@ -64,10 +64,7 @@ Function Get-Settings { "SSLeay" = "ssleay32.dll" "OpenSSLLic" = "OpenSSL_License.txt" "libsodium" = "libsodium.dll" - "concrt" = "concrt140.dll" - "msvcp" = "msvcp140.dll" - "vccorlib" = "vccorlib140.dll" - "vcruntime" = "vcruntime140.dll" + "msvcr" = "msvcr120.dll" } $ini.Add("64bitDLLs", $64bitDLLs) @@ -77,10 +74,7 @@ Function Get-Settings { "SSLeay" = "ssleay32.dll" "OpenSSLLic" = "OpenSSL_License.txt" "libsodium" = "libsodium.dll" - "concrt" = "concrt140.dll" - "msvcp" = "msvcp140.dll" - "vccorlib" = "vccorlib140.dll" - "vcruntime" = "vcruntime140.dll" + "msvcr" = "msvcr120.dll" } $ini.Add("32bitDLLs", $32bitDLLs)