%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/engines/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlm	Z	ddl
mZyddlZWne
k
r�dZnXeje�ZdZeje�Zd�Zdefd	��YZdd
�ZdS(u

An engine that reads messages from the redis sentinel pubsub and sends reactor
events based on the channels they are subscribed to.

.. versionadded: 2016.3.0

:configuration:

    Example configuration

    .. code-block:: yaml

        engines:
          - redis_sentinel:
              hosts:
                matching: 'board*'
                port: 26379
                interface: eth2
              channels:
                - '+switch-master'
                - '+odown'
                - '-odown'

:depends: redis
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tzipurediscC@stdk	rtStdfS(Nu$redis python module is not installed(tredistNonet__virtualname__tFalse(((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pyt__virtual__2stListenercB@s/eZddddd�Zd�Zd�ZRS(cC@s�|dkrd}n|dkr*d}n|dkrBdg}n|dkrWd}ntt|�j�||_tjd|d|dt�|_|jj�|_|jj	|�t
jjj
ttd�j|_dS(	Nu	localhostigu*usalt/engine/redis_sentinelthosttporttdecode_responsesusock_dir(RtsuperR
t__init__ttagRtStrictRedistTruetpubsubt
psubscribetsalttutilsteventtget_master_eventt__opts__t
fire_eventtfire_master(tselfRRtchannelsR((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pyR9s				!c	C@si|dd6}t|dtj�r8|d|d<n�|ddkrz|jtttd|djd
�����nb|ddkr�|jtttd|djd
�d����ni|dd6|dd6}|j|dj	|j
|d��dS(Nuchanneludataucodeu+switch-masterumasteruold_hostuold_portunew_hostunew_portu u+odownu-odownuhostuportiu{0}/{1}(umasteruold_hostuold_portunew_hostunew_port(u+odownu-odown(umasteruhostuport(t
isinstanceRt
integer_typestupdatetdicttlistRtsplitRtformatR(Rtitemtret((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pytworkIs#'cC@sHtjd�x4|jj�D]#}tjd|�|j|�qWdS(NuStart ListeneruItem: %s(tlogtdebugRtlistenR'(RR%((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pytrun\s
N(t__name__t
__module__RRR'R+(((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pyR
8s	c	C@s�|dkrd}ntjj�}|j|dd|dg�j�}td|j�dd|dd	|d
|�}|j�dS(Nusalt/engine/redis_sentinelumatchingunetwork.ip_addrsu	interfaceRiRuportRR(	RRtclienttLocalClienttcmdtvaluesR
tpopR+(thostsRRtlocaltipsR.((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pytstartcs	&/(t__doc__t
__future__RRRtloggingtsalt.clientRtsalt.extRtsalt.ext.six.movesRRtImportErrorRt	getLoggerR,R(RR	tobjectR
R6(((s?/usr/lib/python2.7/site-packages/salt/engines/redis_sentinel.pyt<module>s

	+

Zerion Mini Shell 1.0