%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/slack.pyo

�
���^c@@sNdZddlmZmZmZddlmZd�Zddd�Z	dS(u(
Send a message to Slack
=======================

This state is useful for sending messages to Slack during state runs.

.. versionadded:: 2015.5.0

.. code-block:: yaml

    slack-message:
      slack.post_message:
        - channel: '#general'
        - from_name: SuperAdmin
        - message: 'This state was executed successfully.'
        - api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15

The api key can be specified in the master or minion configuration like below:

.. code-block:: yaml

    slack:
      api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15

i(tabsolute_importtunicode_literalstprint_function(tSaltInvocationErrorcC@sdtkrdStS(u@
    Only load if the slack module is available in __salt__
    uslack.post_messageuslack(t__salt__tFalse(((s5/usr/lib/python2.7/site-packages/salt/states/slack.pyt__virtual__#sc	C@sRi|d6id6td6dd6}tdrMdj|�|d<d|d<|S|sjdj|�|d<|S|s�d	j|�|d<|S|s�d
j|�|d<|Sy/tdd|d
|d|d|d|�}Wn)tk
r�}dj||�|d<nPXt|t�r4|r4t|d<dj|�|d<ndj|d|�|d<|S(u�
    Send a message to a Slack channel.

    .. code-block:: yaml

        slack-message:
          slack.post_message:
            - channel: '#general'
            - from_name: SuperAdmin
            - message: 'This state was executed successfully.'
            - api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15

    The following parameters are required:

    name
        The unique name for this event.

    channel
        The channel to send the message to. Can either be the ID or the name.

    from_name
        The name of that is to be shown in the "from" field.

    message
        The message that is to be sent to the Slack channel.

    The following parameters are optional:

    api_key
        The api key for Slack to use for authentication,
        if not specified in the configuration options of master or minion.

    icon
        URL to an image to use as the icon for this message
    unameuchangesuresultuucommentutestu1The following message is to be sent to Slack: {0}uSlack channel is missing: {0}uSlack from name is missing: {0}uSlack message is missing: {0}uslack.post_messagetchanneltmessaget	from_nametapi_keyticonu!Failed to send message ({0}): {1}uSent message: {0}umessageN(	Rt__opts__tformattNoneRRt
isinstancetbooltTrue(	tnameRR	RR
Rtrettresulttsie((s5/usr/lib/python2.7/site-packages/salt/states/slack.pytpost_message*s>)






N(
t__doc__t
__future__RRRtsalt.exceptionsRRRR(((s5/usr/lib/python2.7/site-packages/salt/states/slack.pyt<module>s
	

Zerion Mini Shell 1.0