%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/xmpp.pyc

�
���^c@@sdZddlmZmZmZddlZeZy*ddlm	Z
ddlmZe
ZWn'ek
r�defd��YZ
nXeje�ZdZd	Zd
�Zdejfd��YZd
e
fd��YZdddd�Zddddddd�ZdS(u�
Module for Sending Messages via XMPP (a.k.a. Jabber)

.. versionadded:: 2014.1.0

:depends:   - sleekxmpp>=1.3.1
            - pyasn1
            - pyasn1-modules
            - dnspython
:configuration: This module can be used by either passing a jid and password
    directly to send_message, or by specifying the name of a configuration
    profile in the minion config, minion pillar, or master config.

    For example:

    .. code-block:: yaml

        my-xmpp-login:
            xmpp.jid: myuser@jabber.example.org/resourcename
            xmpp.password: verybadpass

    The resourcename refers to the resource that is using this account. It is
    user-definable, and optional. The following configurations are both valid:

    .. code-block:: yaml

        my-xmpp-login:
            xmpp.jid: myuser@jabber.example.org/salt
            xmpp.password: verybadpass

        my-xmpp-login:
            xmpp.jid: myuser@jabber.example.org
            xmpp.password: verybadpass

i(tabsolute_importtprint_functiontunicode_literalsN(t
ClientXMPP(t	XMPPErrort_ClientXMPPcB@seZdZRS(u9
        Fake class in order not to raise errors
        (t__name__t
__module__t__doc__(((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyR1suxmppu'Use of send mask waiters is deprecated.cC@str
tStdfS(uI
    Only load this module if sleekxmpp is installed on this minion.
    u.Module xmpp: required libraries failed to load(tHAS_LIBSt__virtualname__tFalse(((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyt__virtual__=stSleekXMPPMUCcB@seZd�ZRS(cC@s|j�tkS(N(t
getMessagetMUC_DEPRECATED(tselftrecord((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pytfilterGs(RRR(((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyR
Fst
SendMsgBotcB@s2eZd�Zedddd��Zd�ZRS(cC@s`tt|�j||�|dkr+gn|g|_g|_||_|jd|j�dS(Nu
session_start(	tsuperRt__init__tNonet
recipientstroomstmsgtadd_event_handlertstart(Rtjidtpasswordt	recipientR((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyRMs
		u
SaltStack BotcC@sXt||d|�}|dkr'gn||_|dkrBgn||_||_|S(uQ
        Alternate constructor that accept multiple recipients and rooms
        N(RRRRtnick(tclsRRRRRRtobj((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pytcreate_multiYs
	cC@s�|j�|j�x0|jD]%}|jd|d|jdd�qWxP|jD]E}|jdj||jdt	�|jd|d|jdd�qQW|j
dt	�dS(Ntmtotmbodytmtypeuchatuxep_0045twaitu	groupchat(t
send_presencet
get_rosterRtsend_messageRRtplugintjoinMUCRtTruet
disconnect(RteventRtroom((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyRes

			N(RRRtclassmethodRR"R(((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyRKs
	
cC@s�|r7td|�}|jd�}|jd�}nt||||�}|jd�|jd�|j�r�|jdt�tStS(u~
    Send a message to an XMPP recipient. Designed for use in states.

    CLI Examples:

    .. code-block:: bash

        xmpp.send_msg 'admins@xmpp.example.com' 'This is a salt module test'             profile='my-xmpp-account'
        xmpp.send_msg 'admins@xmpp.example.com' 'This is a salt module test'             jid='myuser@xmpp.example.com/salt' password='verybadpass'
    u
config.optionuxmpp.jidu
xmpp.passworduxep_0030uxep_0199tblock(t__salt__tgetRtregister_plugintconnecttprocessR,R(RtmessageRRtprofiletcredstxmpp((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pytsend_msgys


u
SaltStack Botc
C@s�x$tjjD]}|jt��q
W|r^td|�}|jd�}|jd�}ntj|||d|d|d|�}	|r�|	j	d�n|	j
�r�y|	jdt�tSWq�t
k
r�}
tjd	|
�q�Xn
tjd
�tS(uD
    Send a message to an XMPP recipient, support send message to
    multiple recipients or chat room.

    CLI Examples:

    .. code-block:: bash

        xmpp.send_msg recipients=['admins@xmpp.example.com']             rooms=['secret@conference.xmpp.example.com']             'This is a salt module test'             profile='my-xmpp-account'
        xmpp.send_msg recipients=['admins@xmpp.example.com']             rooms=['secret@conference.xmpp.example.com']            'This is a salt module test'             jid='myuser@xmpp.example.com/salt' password='verybadpass'

    u
config.optionuxmpp.jidu
xmpp.passwordRRRuxep_0045R1u!Could not send message, error: %su Could not connect to XMPP server(tloggingtrootthandlerst	addFilterR
R2R3RR"R4R5R6R,RtlogterrorR(R7RRRRRR8thandlerR9R:terr((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pytsend_msg_multi�s$!
(Rt
__future__RRRR<RR	t	sleekxmppRRtsleekxmpp.exceptionsRR,tImportErrortobjectt	getLoggerRR@R
RRtFilterR
RRR;RD(((s5/usr/lib/python2.7/site-packages/salt/modules/xmpp.pyt<module>$s,

		.

Zerion Mini Shell 1.0