"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "salt/utils/slack.py" between
salt-3002.1.tar.gz and salt-3002.2.tar.gz

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

slack.py  (salt-3002.1):slack.py  (salt-3002.2)
# -*- coding: utf-8 -*-
""" """
Library for interacting with Slack API Library for interacting with Slack API
.. versionadded:: 2016.3.0 .. versionadded:: 2016.3.0
:configuration: This module can be used by specifying the name of a :configuration: This module can be used by specifying the name of a
configuration profile in the minion config, minion pillar, or master configuration profile in the minion config, minion pillar, or master
config. config.
For example: For example:
.. code-block:: yaml .. code-block:: yaml
slack: slack:
api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
""" """
from __future__ import absolute_import, print_function, unicode_literals
import logging import logging
import salt.ext.six.moves.http_client import salt.ext.six.moves.http_client
# pylint: enable=import-error,no-name-in-module # pylint: enable=import-error,no-name-in-module
import salt.utils.http import salt.utils.http
# Import 3rd-party libs
# pylint: disable=import-error,no-name-in-module,redefined-builtin # pylint: disable=import-error,no-name-in-module,redefined-builtin
from salt.ext.six.moves.urllib.parse import urljoin as _urljoin from salt.ext.six.moves.urllib.parse import urljoin as _urljoin
from salt.version import __version__ from salt.version import __version__
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def query( def query(
function, function,
api_key=None, api_key=None,
args=None, args=None,
skipping to change at line 122 skipping to change at line 119
log.debug(url) log.debug(url)
log.debug(query_params) log.debug(query_params)
log.debug(data) log.debug(data)
log.debug(result) log.debug(result)
if "dict" in result: if "dict" in result:
_result = result["dict"] _result = result["dict"]
if "error" in _result: if "error" in _result:
ret["message"] = result["error"] ret["message"] = result["error"]
ret["res"] = False ret["res"] = False
return ret return ret
ret["message"] = _result.get(response) ret["message"] = "Unknown response"
ret["res"] = False
else: else:
ret["message"] = "invalid_auth" ret["message"] = "invalid_auth"
ret["res"] = False ret["res"] = False
return ret return ret
 End of changes. 4 change blocks. 
4 lines changed or deleted 2 lines changed or added

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