%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s%dZddlmZmZmZddlZddlmZeZ	y�ddl
Z
ege
jD]Z
ee
�^q`�Zedkr�eZddlmZddlmZn&eZddlmZdd	l
mZeZ	Wnek
r�nXeje�Zd
Zd�Zd�Zd
�ZdS(u�
Module for notifications via Twilio

.. versionadded:: 2014.7.0

:depends:   - twilio python module
:configuration: Configure this module by specifying the name of a configuration
    profile in the minion config, minion pillar, or master config.

    For example:

    .. code-block:: yaml

        my-twilio-account:
            twilio.account_sid: AC32a3c83990934481addd5ce1659f04d2
            twilio.auth_token: mytoken
i(tabsolute_importtunicode_literalstprint_functionN(tsixi(tClient(tTwilioException(tTwilioRestClient(tTwilioRestExceptionutwiliocC@str
tStdfS(uF
    Only load this module if twilio is installed on this minion.
    u^The twilio_notify execution module failed to load: the twilio python library is not installed.(tHAS_LIBSt__virtualname__tFalse(((s>/usr/lib/python2.7/site-packages/salt/modules/twilio_notify.pyt__virtual__0scC@s5td|�}t|jd�|jd��}|S(u&
    Return the twilio connection
    u
config.optionutwilio.account_sidutwilio.auth_token(t__salt__Rtget(tprofiletcredstclient((s>/usr/lib/python2.7/site-packages/salt/modules/twilio_notify.pyt_get_twilio9s
cC@s�i}i|d<d|dd<t|�}yRtrZ|jjjd|d|d|�}n!|jjd|d|d|�}Wnatk
r�}i|d<|j|dd<|j|dd<|j	|dd	<t
jd
|�|SXi|d<|j|dd<|j
|dd<|j|dd<|j	|dd	<|j|dd
<|j|dd<tj|j�|dd<tj|j�|dd<t
j|�|S(ux
    Send an sms

    CLI Example:

        twilio.send_sms twilio-account 'Test sms' '+18019999999' '+18011111111'
    umessageusidtbodyttotfrom_u_errorucodeumsgustatusuCould not send sms. Error: %supriceu
price_unitunum_segmentsubodyu	date_sentudate_createdN(tNoneRtTWILIO_5tsmstmessagestcreateRtcodetmsgtstatustlogtdebugtsidtpricet
price_unittnum_segmentsRRt	text_typet	date_senttdate_createdtinfo(RRRRtretRtmessagetexc((s>/usr/lib/python2.7/site-packages/salt/modules/twilio_notify.pytsend_smsFs4
'%


(i(t__doc__t
__future__RRRtloggingtsalt.extRR
Rttwiliottuplet__version_info__txtintttwilio_versionRttwilio.restRRRRtTruetImportErrort	getLoggert__name__RR	RRR*(((s>/usr/lib/python2.7/site-packages/salt/modules/twilio_notify.pyt<module>s,(

			

Zerion Mini Shell 1.0