%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/daemons/flo/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/daemons/flo/core.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZddlZddljjZddlZddlZddlZddlZddlmZddlmZddlmZdd	lmZdd
lm Z ddl!m"Z"ddl#m$Z$dd
l%m&Z&ddl'm(Z(ddl)m*Z*ddl+Z,ddl-m.Z.e.�Z/e0Z1yddl2jj3Z4e5Z1Wne6k
r�nXe0Z7yddl8Z8e5Z7Wne6k
rnXddl9m:Z:ddl;m<Z<ej=e>�Z?de,j@jAjBfd��YZCde,j@jAjBfd��YZDde,j@jAjBfd��YZEde,j@jAjBfd��YZFde,j@jAjBfd��YZGde,j@jAjBfd��YZHde,j@jAjBfd ��YZId!e,j@jAjBfd"��YZJd#e,j@jAjBfd$��YZKd%e,j@jAjBfd&��YZLd'e,j@jAjBfd(��YZMd)e,j@jAjBfd*��YZNd+e,j@jAjBfd,��YZOd-e,j@jAjBfd.��YZPd/e,j@jAjBfd0��YZQd1e,j@jAjBfd2��YZRd3e,j@jAjBfd4��YZSd5e,j@jAjBfd6��YZTd7e,j@jAjBfd8��YZUd9e,j@jAjBfd:��YZVd;e,j@jAjBfd<��YZWd=e,j@jAjBfd>��YZXd?e,j@jAjBfd@��YZYdAe,j@jAjBfdB��YZZdCe,j@jAjBfdD��YZ[dEe,j@jAjBfdF��YZ\dGe\fdH��YZ]dIe\fdJ��YZ^dKe,j@jAjBfdL��YZ_dMe_fdN��YZ`dOe,j@jAjBfdP��YZadQe,j@jAjBfdR��YZbdSebfdT��YZcdUebfdV��YZddWe,j@jAjBfdX��YZedYe,j@jAjBfdZ��YZfd[e,j@jAjBfd\��YZgd]e,j@jAjBfd^��YZhd_e,j@jAjBfd`��YZidae,j@jAjBfdb��YZjdS(cu.
The core behaviors used by minion and master
i(tabsolute_importtprint_functiontunicode_literalsN(tdeque(tgaierror(traeting(t	RoadStack(tRemoteEstate(t	LaneStack(tdaemons(tsalting(t
SaltException(t
is_windows(ttagify(todict(t
getConsole(tsix(trangetSaltRaetCleanupcB@s3eZdZiejjjd�d6Zd�ZRS(ul
    Cleanup stray lane keep directories not reaped

    FloScript:

    do salt raet cleanup at enter

    u
.salt.optsuoptscC@sbt�r^|jjjd�r^tjj|jjd�}tjdj	|��|jjjdg�}x�tj
|�D]�}tjj||�}tjj|�r�qyntjj
|�\}}|dkr�qynt|jd��s�qyn||krqyny'tj|�tjdj	|��Wqytk
rVtjdj	|���qyXqyWndS(	uG
        Should only run once to cleanup stale lane uxd files.
        usock_diruCleaning up uxd files in {0}
uraet_cleanup_protectedsu.uxdu.uRemoved {0}
uFailed removing {0}
N(Rtoptstvaluetgettostpathtabspathtconsoletconcisetformattlistdirtjointisdirtsplitexttallt	partitiontunlinktOSError(tselftsockdirpatht
protectedstnameRtroottext((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pytactionTs*

(	t__name__t
__module__t__doc__tsalttutilststringutilstto_strtIoinitsR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRGstSaltRaetRoadClusteredc	B@sneZdZedejjjd�dedejjjd�de�dejjjd��Z	d	�Z
RS(
u�
    Updates value of share .salt.road.manor.cluster.clustered
    Twith opts['cluster_mode']

    FloScript:

    do salt raet road clustered
    go next if .salt.road.manor.cluster.clustered

    tinodeu.salt.road.manor.t	clusteredtipathucluster.clusteredtivalRu
.salt.optscK@s)|jjd|jjjdt��dS(u;
        Update .cluster.clustered share from opts
        Rucluster_modeN(R5tupdateRRRtFalse(R$tkwa((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*s(R+R,R-RR.R/R0R1R9R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR3os
	tSaltRaetProcessManagerSetupcB@s3eZdZiejjjd�d6Zd�ZRS(u+
    Set up the process manager object
    u.salt.usr.proc_mgruproc_mgrcC@stjjj�|j_dS(u,
        Create the process manager
        N(R.R/tprocesstProcessManagertproc_mgrR(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR;�stSaltRaetRoadUsherMinionSetupcB@s_eZdZedejjjd�dejjjd�dejjjd��Zd�Z	RS(u�
    Set up .ushers which is initial list of masters to bootstrap
    into road

    FloScript:

    do salt raet road usher minion setup at enter

    R4u.salt.road.manor.tushersuushersRu
.salt.optscC@sXd}d}|jjjdt�r-d}ntj|jjd|d|�|j_dS(u0
        Assign .ushers by parsing opts
        umasterucluster_modeucluster_masterstmasterstportN(tNoneRRRR9R	textract_mastersR@(R$RARB((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s	(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR?�s	tSaltRaetRoadUsherMasterSetupcB@s_eZdZedejjjd�dejjjd�dejjjd��Zd�Z	RS(u�
    Set up .ushers which is initial list of masters to bootstrap
    into road

    FloScript:

    do salt raet road usher master setup at enter

    R4u.salt.road.manor.R@uushersRu
.salt.optscC@s=d}d}tj|jjd|d|dt�|j_dS(u0
        Assign .ushers by parsing opts
        ucluster_mastersu	raet_portRARBtraise_if_emptyN(R	RDRRR9R@(R$RARB((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRE�s	tSaltRaetRoadClusterLoadSetupc
B@s�eZdZedejjjd�diejjjd�d6e�d6dejjjd�d	ejjjd
��Zd�Z	RS(ux
    Sets up cluster.masters for load balancing

    FloScript:

    do salt raet road cluster load setup at enter

    R4u.salt.road.manor.RAucluster.mastersuipathuivaltstackustackRu
.salt.optscK@s�|jjjd�r~xft|jjjj��D]F}|jtj	j
kr1tddd|jj
�|jj|j<q1q1WndS(u>
        Populate loads from masters in stack.remotes
        ucluster_modetloadgtexpireN(RRRtlistRHtremotestvaluestkindtkindst	applKindstmasterRtstoretstampRAR'(R$R:tremote((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s"(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRG�s&tSaltRaetRoadStackSetupcB@seZdZiejjjd�d6ejjjd�d6ejjjd�d6iejjjd�d6e�d6d6iejjjd	�d6e�d6d	6iejjjd
�d6ied6ed6dd
6dd6dd6dd6dd6d6d
6Z
d�Zd�ZRS(up
    Initialize and run raet udp stack for Salt
    FloScript:

    do salt raet road stack setup at enter

    usalt.road.manor.uinodeustacku
.salt.optsuoptsutxmsgsuipathuivalurxmsgsulocalumainumutableuuidumasteruroleusighexuprihexiubufcntcC@stjjjt_dt_dS(u'
        Assign class defaults
        gN(RtBodyKindtmsgpackRRtBktJoinentTimeout(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_prepare�sc$C@s$|jjd}|tjkrNdj|�}tj|d�t|��n|jjjdd�}|s�d}tj|d�t|��ndj||�}|jjjd|j	j
j�}|jjjd	|j	j
j�}|jjjd
t
�}|p|}|j	j
j}|tjtjjkrU|jjd|jjdf}	n |jjd|jjd
f}	tjjtjj|jjdd��}
|jj}|jj}tjd|jjd|
d|�}
|
j�}|dp�|j	j
j}|dp|j	j
j}|jjjd|j	j
j�}td|jd|
d|d|d|	d|d|d|d|dtj|d |d!|d"|d#d$d%d&d'|�|j _|jjjd(�r x<t!|j jj"j#��D]}|j jj$|d)t%�q�W|j jj&|j _'nd*S(+u�
        enter action
        should only run once to setup road stack.
        moved from _prepare so can do clean up before stack is initialized

        do salt raet road stack setup at enter
        u__roleu!Invalid application kind = '{0}'.u
uiduu)Missing role required to setup RoadStack.u{0}_{1}u	raet_mainuraet_mutableu	open_modeu	interfaceu
raet_alt_portu	raet_portucachediruraetRtbasedirpatht	stacknameusighexuprihexuraet_road_bufcntRRtkeepR'tuidthatroletsigkeytprikeytmainRNtmutablettxMsgstrxMsgstperiodg@toffsetg�?tbufcnturaet_clear_remotestclearN((RRROt
APPL_KINDSRtlogterrort
ValueErrorRtlocaltdataRcRdR9R^tAPPL_KIND_NAMESRPtcallerRRRRttxmsgstrxmsgsR
tSaltKeeptloadLocalRoleDatatsighextprihexRiRRRRHRKRLRMtremoveRemotetTruetUidtpuid(R$RNtemsgR`R'RcRdtalwaysR^R_R[ReRfR]troledataRwRxRiRT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*sb!!# +	!
"N(
R+R,R-R.R/R0R1RR9RCR2RZR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRU�s&
	tSaltRaetRoadStackClosercB@sJeZdZedejjjd�dejjjd��Zd�Z	RS(uk
    Closes stack server socket connection
    FloScript:

    do salt raet road stack closer at exit

    R4u.salt.road.manor.RHustackcK@s;|jjr7t|jjt�r7|jjjj�ndS(u"
        Close udp socket
        N(RHRt
isinstanceRtservertclose(R$R:((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*Ws!(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�Ks
tSaltRaetRoadStackJoinerc
B@steZdZedejjjd�dejjjd�dejjjd�dejjjd��Zd	�Z	RS(
u�
    Initiates join transaction with master(s)
    FloScript:

    do salt raet road stack joiner at enter

    assumes that prior the following has been run to setup .masters

    do salt raet road usher minion setup

    R4u.salt.road.manor.RHustackR@uushersRu
.salt.optsc	K@s,|jj}|r(t|t�r(|jjjdt�p@|j}|jjjdt�pb|j}|r�xKt|jj	��D]1}|j
tjj
kr�|j|dt�q�q�Wn|r�x3t|jj	��D]}|j|dt�q�Wn|s|r�|j|_td�}x�|jjD]�}yB|d}|jtd|ddd	dd
|dtjj
��Wq&tk
r�}tjd||�|jjjd
�dkr�|�q�q&Xq&W|js�|�q�nxQt|jj	��D]7}|j
tjj
kr�|jd|jdd�q�q�WndS(u'
        Join with all masters
        uraet_clear_remote_mastersuraet_clear_remotesRjuUnable to connect to any masteruexternalRHtfuiditsidR_RNu"Unable to connect to master %s: %sumaster_typeufailoverudistributedR^ttimeoutgN(ufailoverudistributed(RHRR�RRRRzRLRKRMRNRORPRQRyR{R|RR@t	addRemoteRRRltwarningRR^(	R$R:RHtrefresh_masterstrefresh_allRTtexRQtmha((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*qsB

	(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�_stSaltRaetRoadStackJoinedcB@s�eZdZedejjjd�dejjjd�dedejjjd�ded	ed
ededed
e���Z	d�Z
RS(u�
    Updates status with .joined of zeroth remote estate (master)
    FloScript:

    do salt raet road stack joined
    go next if joined in .salt.road.manor.status

    R4u.salt.road.manor.RHustacktstatusR6ustatusR7tjoinedtallowedtalivedtrejectedtidlecK@s�|jj}t}|r|t|t�r||jr|tgt|jj��D]$}|j	t
jjkrI|j
^qI�}q|n|jjd|�dS(u&
        Update .status share
        R�N(RHRR9R�RRLtanyRKRMRNRORPRQR�R�R8(R$R:RHR�RT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s	-(R+R,R-RR.R/R0R1R9R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoadStackRejectedcB@s�eZdZedejjjd�dejjjd�dedejjjd�ded	ed
ededed
e���Z	d�Z
RS(u�
    Updates status with rejected of .acceptance of zeroth remote estate (master)
    FloScript:

    do salt raet road stack rejected
    go next if rejected in .salt.road.manor.status

    R4u.salt.road.manor.RHustackR�R6ustatusR7R�R�R�R�R�cK@s�|jj}t}|r�t|t�r�|jr�tg|jj�D]3}|jt	j
jkrC|jt
jjjk^qC�}q�t}n|jjd|�dS(u&
        Update .status share
        R�N(RHRR9R�RRLR RMRNRORPRQt
acceptanceRt
AcceptanceR�RzR�R8(R$R:RHR�RT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s	9	(R+R,R-RR.R/R0R1R9R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoadStackAllowercB@sJeZdZedejjjd�dejjjd��Zd�Z	RS(u�
    Initiates allow (CurveCP handshake) transaction with master
    FloScript:

    do salt raet road stack allower at enter

    R4u.salt.road.manor.RHustackcK@ss|jj}|rot|t�roxK|jj�D]7}|jtjj	kr1|j
d|jdd�q1q1WndS(uk
        Receive any udp packets on server socket and put in rxes
        Send any packets in txes
        R^R�gN(RHRR�RRLRMRNRORPRQtallowR^(R$R:RHRT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s
(
R+R,R-RR.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��s
tSaltRaetRoadStackAllowedcB@s�eZdZedejjjd�dejjjd�dedejjjd�ded	ed
ededed
e���Z	d�Z
RS(u�
    Updates status with .allowed of zeroth remote estate (master)
    FloScript:

    do salt raet road stack allowed
    go next if allowed in .salt.road.manor.status

    R4u.salt.road.manor.RHustackR�R6ustatusR7R�R�R�R�R�cK@s�|jj}t}|r|t|t�r||jr|tgt|jj��D]$}|j	t
jjkrI|j
^qI�}q|n|jjd|�dS(u&
        Update .status share
        R�N(RHRR9R�RRLR�RKRMRNRORPRQR�R�R8(R$R:RHR�RT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*s	-(R+R,R-RR.R/R0R1R9R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoadStackManagercB@s8eZdZedejjjd�dejjjd�diejjjd�d6e�d6d	iejjjd
�d6e�d6diejjjd�d6e�d6d
iejjjd�d6e�d6diejjjd�d6ede�de��d6dejjjd��Z	d�Z
d�ZRS(ue
    Runs the manage method of RoadStack
    FloScript:
        do salt raet road stack manager

    R4u.salt.road.manor.RHustacktallowedsu.salt.var.presence.allowedsuipathuivaltalivedsu.salt.var.presence.alivedstreapedsu.salt.var.presence.reapedst
availablesu.salt.var.presence.availablestchangedsu.salt.var.presence.changedstplustminusteventu.salt.event.eventscC@s<|jj}|jjjs*|jjjr�it|jjj�d6t|jjj�d6}tdd�}idd6d|j	j
dfd6}i|d6|d	6|d
6}|jjj|�nit|j
j�d6}tdd�}id
d6d|j	j
dfd6}i|d6|d	6|d
6}|jjj|�dS(Nunewulostuchangeupresenceu
event_fireudstusrcurouteutagudataupresent(NNu
event_fire(NNu
event_fire(RHRR�RpR�R�RKR
RCRoR'R�tappendR�(R$RHRpttagtroutetmsg((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_fire_events/s

c
K@sO|jj}|rKt|t�rK|jdt�t|jjj�|j_|jj	dt|jjjd��|jj	dt|jjjd��t
|jjj�|j_t
|jjj�|j_t
|jjj
�|j
_tjdj|j|jj|jjj|jjj|jj|jj|j
j��|j�ndS(u�
        Manage the presence of any remotes

        availables is set of names of alive remotes which are also allowed
        changeds is is share with two fields:
            plus is set of names of newly available remotes
            minus is set of names of newly unavailable remotes
        alloweds is dict of allowed remotes keyed by name
        aliveds is dict of alived remotes keyed by name
        reapeds is dict of reaped remotes keyed by name
        tcascadeR�uplusR�uminusud Manage {0}.
Availables: {1}
Changeds:
Plus: {2}
Minus: {3}
Alloweds: {4}
Aliveds: {5}
Reapeds: {6}
N(RHRR�RtmanageRztsetR�R�R8RR�R�R�RRRR'RpR�R�R�(R$R:RH((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*Bs$&&			(R+R,R-RR.R/R0R1R�R2R�R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�s"



	tSaltRaetRoadStackPrinterc	B@s\eZdZedejjjd�dedejjjd�de���Z	d�Z
RS(ur
    Prints out messages on rxMsgs queue for associated stack
    FloScript:

    do raet road stack printer

    R4u.salt.road.manor.RtR6urxmsgsR7cK@sE|jj}x2|r@|j�\}}tjdj|��qWdS(u"
        Queue up message
        u
Received....
{0}
N(RtRtpopleftRtterseR(R$R:RfR�R'((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*rs	(R+R,R-RR.R/R0R1RR2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�fs
*tSaltLoadModulescB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6ejjjd�d6Zd�Zd�Z	d�Z
RS(uV
    Reload the minion modules
    FloScript:

    do salt load modules at enter

    u
.salt.optsuoptsu.salt.grainsugrainsu.salt.loader.utilsuutilsu.salt.loader.modulesumodulesu.salt.var.grain_timeu
grain_timeu.salt.var.module_refreshumodule_refreshu.salt.loader.returnersu	returnersu.salt.loader.executorsumodule_executorscC@s|j�dS(N(t
_load_modules(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRZ�scC@s|j�dS(N(R�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�scC@s�|jjdkr!d|j_nt}|jjjdd�dkr�tr�tr�tj	d|jjd�t
}tjtj
�}tjtj��j�d \}}|||jjd}tjtj
||f�nM|jjjdd�dkr)tstjd�nts)tjd�q)ntj�|jjd	ksQ|jjr�tjj|jj�|jjd
<tj�|j_|jjd
|j_ntjj|jj�|j_tjj|jjd|jj�|j_tjj|jj|jj�|j_tjj|jj|jj�|j_|jjj �|jjj �|jjj �|jjj �|t
kr�tjtj
|�nt|j_dS(
ua
        Return the functions and the returners loaded up from the loader
        module
        gumodules_max_memoryi����iu1modules_max_memory set, enforcing a maximum of %siu>Unable to enforce modules_max_memory because psutil is missingu@Unable to enforce modules_max_memory because resource is missingg�r@ugrainsR/N(!t
grain_timeRRCR9RRt
HAS_PSUTILtHAS_RESOURCERltdebugRztresourcet	getrlimitt	RLIMIT_AStpsutiltProcessRtgetpidtmemory_infot	setrlimitRmttimetmodule_refreshR.tloadertgrainsR/tminion_modstmodulest	returnerst	executorstmodule_executorsRj(R$tmodules_max_memoryt
old_mem_limittrsstvmst	mem_limit((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��s>*	%("*''(R+R,R-R.R/R0R1R2RZR*R�(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�|s		tSaltLoadPillarcB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6Zd�ZRS(uL
    Load up the initial pillar for the minion

    do salt load pillar
    u
.salt.optsuoptsu.salt.pillarupillaru.salt.grainsugrainsu.salt.loader.modulesumodulesu.salt.var.pillar_refreshupillar_refreshu.salt.road.manor.stacku
road_stacku.salt.track.master_estate_nameumaster_estate_namec	C@s=gt|jjjj��D]}|jr|^q}xH|s�g|jjjj�D]}|jrV|^qV}tjd�q:W|jjj	d�}|r�|t
jdt|�d�}n
|d}|j
|j_i|jjjj
ddfd6|j
ddfd6}i|jjdd6|jjd	6|jjd
d
6dd6d
d6}|jjji|d6|d6d|j�|jjj�x�tr8tjd�x�|jjjr$|jjjj�\}}|j	di�|j_|jjdkr�q�n|jj|jjd<t|j_dSW|jjj�q�WdS(u 
        Initial pillar
        g�������?u
random_masteriiusrcu
remote_cmdudstuidugrainsusaltenvu2uveru_pillarucmdurouteuloadR^ureturnupillarN(RKt
road_stackRRLRMR�R�tsleepRRtrandomtrandinttlenR'tmaster_estate_nameRoRCR�ttransmitR^t
serviceAllRzRfR�tpillarR9tpillar_refresh(	R$RTtavailable_masterst
random_masterRQR�RIR�tsender((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s@"	#


 
	
(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltSchedulecB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6Zd�Zd�Z	RS(
uF
    Evaluates the schedule
    FloScript:

    do salt schedule

    u
.salt.optsuoptsu.salt.grainsugrainsu.salt.loader.utilsuutilsu.salt.loader.modulesumodulesu.salt.loader.returnersu	returnerscC@s�tjj|jj�|j_tjj|jjd|jj�|j_tjj|jj|jj�|j_tjjj	|jj|jj|jj�|_dS(u7
        Map opts and make the schedule object
        R/N(
R.R�R/RRR�R�R�tscheduletSchedule(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRZs*'		cC@s|jj�dS(u#
        Eval the schedule
        N(R�teval(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*s(
R+R,R-R.R/R0R1R2RZR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��s	tSaltRaetManorLaneSetupcB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6iejjjd�d6idd6d d!6d"6d6Zd#�Zd$�Z	RS(%u�
    Only intended to be called once at the top of the manor house
    Sets up the LaneStack for the main yard
    FloScript:

    do salt raet manor lane setup at enter

    u
.salt.optsuoptsu.salt.event.yardsuevent_yardsu.salt.var.local_cmdu	local_cmdu.salt.var.remote_cmdu
remote_cmdu.salt.var.publishupublishu
.salt.var.funufunu.salt.var.worker_verifyu
worker_verifyu.salt.event.eventsueventu.salt.event.event_requ	event_requ.salt.presence.event_requpresence_requ.salt.stats.event_requ	stats_requ.salt.track.workersuworkersu.salt.lane.manor.uinodeustackulocaluipathumasterulanenameidubufcntuivalcC@sdS(u4
        Set up required objects and queues
        N((R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRZ7sc		C@s�|jjd}|tjkrNdj|�}tj|d�t|��n|tjtj	j
tjtj	jgkr�d}n�|tjtj	jtjtj	j
gkr|jjjdd�}|s�d}tj|d�t|��ndj||�}n,d	j|�}tj|d�t|��|jjjd
|jjj�}d}td|d
|d|jjdd|�|j_tjjj|jj_t�|j_t�|j_t�|j_t�|j_t�|j_t�|j_t�|j _t�|j!_t�|j"_t#j$j%j&�|j'_|jjjd�r�g}x8t(|jjd�D] }|j)dj|d��quWt*j+|�|j,_ndS(u#
        Run once at enter
        u__roleu0Invalid application kind = '{0}' for manor lane.u
umasteruiduu*Missing role required to setup manor Lane.u{0}_{1}u4Unsupported application kind = '{0}' for manor Lane.uraet_lane_bufcntumanorR'tlanenameR%usock_dirRiuworker_threadsu	worker{0}iN(-RRRORkRRlRmRnRqRPRQtsyndictminionRrRRoRpRiRRHRtPackKindtpacktPkR�tevent_yardsRt	local_cmdt
remote_cmdtfunR�t	event_reqtpresence_reqt	stats_reqtpublishR.R/R0R�t
worker_verifyRR�t	itertoolstcycletworkers(	R$RNR}R�R`RiR'tworker_seedtindex((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*=sT	!(
R+R,R-R.R/R0R1R2RZR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�s(
	tSaltRaetLaneStackClosercB@s,eZdZedddd�Zd�ZRS(uk
    Closes lane stack server socket connection
    FloScript:

    do raet lane stack closer at exit

    R4u.salt.lane.manorRHustackcK@s;|jjr7t|jjt�r7|jjjj�ndS(u"
        Close uxd socket
        N(RHRR�RR�R�(R$R:((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*}s!(R+R,R-RR2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�qs
	tSaltRaetRoadStackServicecB@s3eZdZiejjjd�d6Zd�ZRS(u<
    Process the udp traffic
    FloScript:

    do rx

    u.salt.road.manor.stacku
road_stackcC@s|jjj�dS(u'
        Process inboud queues
        N(R�RR�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoadStackServiceRxcB@s3eZdZiejjjd�d6Zd�ZRS(ub
    Process the inbound Road traffic
    FloScript:

    do salt raet road stack service rx

    u.salt.road.manor.stacku
road_stackcC@s|jjj�dS(u'
        Process inboud queues
        N(R�RtserviceAllRx(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoadStackServiceTxcB@s3eZdZiejjjd�d6Zd�ZRS(uc
    Process the outbound Road traffic
    FloScript:

    do salt raet road stack service tx

    u.salt.road.manor.stacku
road_stackcC@s|jjj�dS(u(
        Process inbound queues
        N(R�RtserviceAllTx(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetLaneStackServiceRxcB@s3eZdZiejjjd�d6Zd�ZRS(ub
    Process the inbound Lane traffic
    FloScript:

    do salt raet lane stack service rx

    u.salt.lane.manor.stacku
lane_stackcC@s|jjj�dS(u'
        Process inboud queues
        N(t
lane_stackRR�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetLaneStackServiceTxcB@s3eZdZiejjjd�d6Zd�ZRS(uc
    Process the outbound Lane traffic
    FloScript:

    do salt raet lane stack service tx

    u.salt.lane.manor.stacku
lane_stackcC@s|jjj�dS(u)
        Process outbound queues
        N(R�RR�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��stSaltRaetRoutercB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6iejjjd�d 6e�d!6d"6Zd#�Z	d$�Z
ed%�Zd&�Z
d'�ZRS((ue
    Routes the communication in and out of Road and Lane connections

    This is a base class

    u
.salt.optsuoptsu.salt.var.local_cmdu	local_cmdu.salt.var.remote_cmdu
remote_cmdu.salt.var.publishupublishu
.salt.var.funufunu.salt.event.eventsueventu.salt.event.event_requ	event_requ.salt.presence.event_requpresence_requ.salt.stats.event_requ	stats_requ.salt.var.presence.availablesu
availablesu.salt.track.workersuworkersu.salt.var.worker_verifyu
worker_verifyu.salt.lane.manor.stacku
lane_stacku.salt.road.manor.stacku
road_stacku.salt.track.master_estate_nameumaster_estate_nameu.salt.lane.manor.latersuipathuivalulaterscC@sdS(u�
        Send to the right queue
        msg is the message body dict
        sender is the unique name of the remote estate that sent the message
        N((R$R�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_process_road_rxmsgscC@sdS(u�
        Send uxd messages tot he right queue or forward them to the correct
        yard etc.

        msg is message body dict
        sender is unique name  of remote that sent the message
        N((R$R�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_process_lane_rxmsg
scC@s�|jj}|jjjj|jj�}|s;|jr�gtj|jjj	�D]}|jrT|^qT}|r�|jd�}|r�|t
jdt|�d�}q�|d}q�d}n|r�|jnd|j_|jjS(u
        Assign and return the name of the estate for the default master or empty if none
        If the default master is no longer available then selects one of the available
        masters

        If clustered is True then use load balancing algorithm to select master
        u
random_masteriiuN(RRR�tnameRemotesRR�R�RtIteratorRLR�R�R�RCR'(R$R5RRQRTR�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_get_master_estate_names#
	c@sLdjtjtjj��tt|�t�fd�|jjD��@�S(u�
        Return set that is intersection of associated minion estates for
        roles in minions and the set of available minion estates.
        u_{0}c3@s|]}|j��VqdS(N(trstrip(t.0R'(tsuffix(s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pys	<genexpr>6s(	RRORqRPR�RKR�R�R(R$tminions((Rs9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_availablize/scC@s�xD|jjjrF|jjjj�\}}|jd|d|�qWxD|jjr�|jjj�\}}|jjjj||f�qJWxD|jjjr�|jjjj�\}}|jd|d|�q�WdS(u'
        Process the messages!
        R�R�N(	R�RRfR�R�tlatersR�R�R�(R$R�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*8s (R+R,R-R.R/R0R1RR2R�R�R9RRR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��s.		
		tSaltRaetRouterMastercB@s eZdZd�Zd�ZRS(u�
    Routes the communication in and out of Road and Lane connections
    Specific to Master

    do salt raet router master

    c
C@sy2|dd\}}}|dd\}}}Wn(ttfk
r\tjd|�dSX|dkrmdStjd|jjd|jjj	j
|jjj	j
|�|dk	r�||jjj	j
kr�tjd|�dS|dk	r.||jjjkr*|jjj
||jjj|j�ndS|dkrNtjd	|�dS|d
krq|jjj|�dS|dkr�tjd|�dS|d
krd|kr|jjj|j}	|	|dd<|jjj
||jjjt|jj���qndS(u�
        Send to the right queue
        msg is the message body dict
        sender is the unique name of the remote estate that sent the message
        urouteusrcudstuReceived invalid message: %sNu:**** Road Router rxMsg **** id=%s estate=%s yard=%s
msg=%suidu1Road Router Received message for wrong estate: %su"Received message without share: %su
event_fireu	local_cmdu-Received local command remotely! Ignoring: %su
remote_cmduload(Rnt
IndexErrorRlRmRCR�RRR�RoR'R�R�R�R^R�R�R`tfetchUidByNametnextR�(
R$R�R�ts_estatets_yardts_sharetd_estatetd_yardtd_shareR`((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�OsJ
$c	C@sy2|dd\}}}|dd\}}}Wn(ttfk
r\tjd|�dSX|dkrmdS|dkr�|jjjj}|||f|dd<ntj	d|j
jd|jjjj|jjjj|�|dkr�nZ||jjjjkrI||jjjkrE|jjj
||jjj|j�ndS|dkr�|j|d	d
d�|d	d
d<|jd�|jjkr�|jjj|�q�n|dkr�nZ||jjjjkr||jjjkr|jjj||jjj|j�ndS|dkr9tjd
|�dS|dkry|jjj||jjjt|jj���n�|dkr�|jjj|�nf|dkr�|jjj|�nD|dkr�|jjj|�n"|dkr|jjj|�ndS(u�
        Send uxd messages tot he right queue or forward them to the correct
        yard etc.

        msg is message body dict
        sender is unique name  of remote that sent the message
        urouteusrcudstu(Lane Router Received invalid message: %sNu:**** Lane Router rxMsg **** id=%s estate=%s yard=%s
msg=%suidupub_retureturnuretuminionsu__worker_verifyu.Lane Router Received message without share: %su	local_cmdu	event_requ
event_fireupresence_requ	stats_req(RnR	RlRmRCR�RRoR'R�RR�R�tmessageR^RRR�R�R�R�R
RR�R�R�R�R�(	R$R�R�RR
RRRR((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��sb
'%(R+R,R-R�R�(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRGs	6tSaltRaetRouterMinioncB@s5eZdZd�Zd�Zed�Zd�ZRS(u�
    Routes the communication in and out of Road and Lane connections
    Specific to Minions

    do salt raet router minion

    c	C@s�y2|dd\}}}|dd\}}}Wn(ttfk
r\tjd|�dSX|dkrmdStjd|jjd|jjj	j
|jjj	j
|�|dk	r�||jjj	j
kr�tjd|�dS|dk	r/||jjjkr+|jjj
||jjj|j�dSdS|dkrOtjd	|�dS|d
kr�|jjjtjjkr�|jjj|�q�n"|dkr�|jjj|�ndS(u�
        Send to the right queue
        msg is the message body dict
        sender is the unique name of the remote estate that sent the message
        urouteusrcudstuReceived invalid message: %sNu:**** Road Router rxMsg **** id=%s estate=%s yard=%s
msg=%suidu1Road Router Received message for wrong estate: %su"Received message without share: %sufunu	stats_req(RnR	RlRmRCR�RRR�RoR'R�R�R�R^RNRORPR�R�R�R�(	R$R�R�RR
RRRR((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR��s>
$c	C@s	y2|dd\}}}|dd\}}}Wn(ttfk
r\tjd|�dSX|dkrmdS|dkr�|jjjj}|||f|dd<ntj	d|j
jd|jjjj|jjjj|�|dkr�nZ||jjjjkrI||jjjkrE|jjj
||jjj|j�ndS|dkrXn[||jjjjkr�||jjjkr�|jjj||jjj|j�dSdS|dkr�tjd|�dS|d	kr�|jjj|�n|d
kr|jjj|�n�|dkr|jjjs\tjd�|jjj||f�dS|jd
|j
jdt��}|s�tjd�|jjj||f�dS|||f|dd<tj	d|dd�|jjj
||jjj|j�ndS(u�
        Send uxd messages tot he right queue or forward them to the correct
        yard etc.

        msg is message body dict
        sender is unique name  of remote that sent the message
        urouteusrcudstu(Lane Router Received invalid message: %sNu:**** Lane Router rxMsg **** id=%s estate=%s yard=%s
msg=%suidu.Lane Router Received message without share: %su	event_requ
event_fireu
remote_cmduN**** Lane Router: Missing joined master. Unable to route remote_cmd. RequeuingR5ucluster_modeu]**** Lane Router: No available destination estate for 'remote_cmd'.Unable to route. RequeuinguV**** Lane Router: Missing destination estate for 'remote_cmd'. Using default route=%s.(RnR	RlRmRCR�RRoR'R�RR�R�RR^R�R�R�R�RLRRRR9(	R$R�R�RR
RRRR((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�sl

!
	cC@s�|jj}|jjjj|jj�}|s;|jr�gt|jjjj	��D]}|jrW|^qW}|r�|jd�}|r�|t
jdt|�d�}q�|d}q�d}n|r�|jnd|j_|jjS(u�
        Assign and return the name of the estate for the default master or empty if none
        If the default master is no longer available then selects one of the available
        masters
        u
random_masteriiuN(RRR�R�RR�R�RKRLRMR�R�R�RCR'(R$R5RRQRTR�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRTs#
	c@sLdjtjtjj��tt|�t�fd�|jjD��@�S(u�
        Return set that is intersection of associated minion estates for
        roles in minions and the set of available minion estates.
        u_{0}c3@s|]}|j��VqdS(N(R(RR'(R(s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pys	<genexpr>ts(	RRORqRPR�RKR�R�R(R$R((Rs9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRms(R+R,R-R�R�R9RR(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�s
	/	NtSaltRaetEventercB@s�eZdZi	ejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6ejjjd�d6ejjjd�d6Zd�Zd�Z	d�Z
RS(u@
    Fire events!
    FloScript:

    do salt raet eventer

    u
.salt.optsuoptsu.salt.event.yardsuevent_yardsu.salt.event.eventsueventu.salt.event.event_requ	event_requ.salt.var.module_refreshumodule_refreshu.salt.var.pillar_refreshupillar_refreshu.salt.lane.manor.stacku
lane_stacku.salt.road.manor.stacku
road_stacku.salt.var.presence.availablesu
availablescC@s#|jjj|ddd�dS(uP
        register an incoming event request with the requesting yard id
        urouteusrciN(R�Rtadd(R$R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_register_event_yard�scC@s�g}|jd�dkr*t|j_n|jd�dkrNt|j_nxq|jjD]c}||jjjkr�|j|�q[n|jjj	||jjj
|��|jjj�q[Wx!|D]}|jjj|�q�WdS(ud
        Forward an event message to all subscribed yards
        Event message has a route
        utagupillar_refreshumodule_refreshN(
RRzR�RR�R�R�R�R�R�R
R�tremove(R$R�trm_ty_name((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_forward_event�s

cC@s\x)|jjr+|j|jjj��qWx)|jjrW|j|jjj��q/WdS(uc
        Register event requests
        Iterate over the registered event yards and fire!
        N(R�RRR�R�R(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(R+R,R-R.R/R0R1R2RRR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRws		tSaltRaetEventerMastercB@seZdZd�ZRS(uG
    Fire events!
    FloScript:

    do salt raet eventer master

    cC@s tt|�j|�|jjjd�r|jd�dkr|jjtd�t	|j
jjj��D��@}x�|D]�}|j
jj
|}|j
jj|d<|dd\}}}|j
jj||f|dd<|jddf|dd<|j
jj||j�q|WqndS(	u�
        Forward an event message to all subscribed yards
        Event message has a route
        Also rebroadcast to all masters in cluster
        ucluster_modeuorigincs@s-|]#}|jtjjkr|jVqdS(N(RNRORPRQR'(RRT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pys	<genexpr>�surouteusrcu
event_fireudstN(tsuperRRRRRRCR�R�RKR�RLRMR�R'RR^(R$R�RAR'RTRR
R((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�s	,
 (R+R,R-R(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�stSaltRaetPresentercB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6ejjjd�d6ejjjd
�d6Zd�Zd�Z	RS(uK
    Fire presence events!
    FloScript:

    do salt raet presenter

    u
.salt.optsuoptsu.salt.presence.event_requpresence_requ.salt.lane.manor.stacku
lane_stacku.salt.var.presence.allowedsuallowedsu.salt.var.presence.alivedsualivedsu.salt.var.presence.reapedsureapedsu.salt.var.presence.availablesu
availablesc
C@s�|ddd}||jjjkr*n�d|krWd|dkrW|dd}nd}|dkr�t�}xI|jjD];}|jjj|d�}|r�|jdnd||<qWi|d6}n�i|j	d	6|j	d
6|jd6|j
d6}y||j}	Wn"tk
r1tj
d
|�dSXt�}
x#|	D]}|	|jd|
|<qBWi|
|6}tdd�}idd6d|jjjjdfd6}i|d6|d6|d6}|jjj||jjj|��|jjj�dS(uj
        Forward an presence message to all subscribed yards
        Presence message has a route
        urouteusrciudataustateu	availableupresentiujoineduallowedualivedureapedu(Lane Router Received invalid message: %sNupresenceu
event_fireudstutag(Nu	availableupresent(NNu
event_fire(R�RR�RCRR�R�RR_R�R�tKeyErrorRlRmR
RoR'R�R
R�(
R$R�RtstatetpresentR'R�RptstatesRtresultR�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_send_presence�s@	!




	


cC@s0x)|jjr+|j|jjj��qWdS(ui
        Register presence requests
        Iterate over the registered presence yards and fire!
        N(R�RR#R�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*s(
R+R,R-R.R/R0R1R2R#R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR�s	/tSaltRaetStatsEventercB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6Zd	�Zd
�Z	d�Z
RS(uK
    Fire stats events
    FloScript:

    do salt raet state eventer

    u
.salt.optsuoptsu.salt.stats.event_requ	stats_requ.salt.lane.manor.stacku
lane_stacku.salt.road.manor.stacku
road_stackcC@sdS(uc
        Forward a stats message to all subscribed yards
        Stats message has a route
        N((R$R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_send_stats)scC@s\|tdd�kr"|jjjS|tdd�krD|jjjStjd|�dSdS(NuroadustatsulaneuMissing or invalid tag: %s(R
R�RtstatsR�RlRmRC(R$R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt
_get_stats0s

cC@s0x)|jjr+|j|jjj��qWdS(uF
        Iterate over the registered stats requests and fire!
        N(R�RR%R�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*9s(R+R,R-R.R/R0R1R2R%R'R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR$s			tSaltRaetStatsEventerMastercB@seZd�ZRS(cC@s�|ddd}||jjjkr+dS|j|jd��}|dkrSdSid	d6d|jjjjdfd6}i|d6|jd�d6|d6}|jjj||jjj	|��|jjj
�dS(
uc
        Forward a stats message to all subscribed yards
        Stats message has a route
        urouteusrciNutagu
event_fireudstudata(NNu
event_fire(R�RR�R'RRCRoR'R�R
R�(R$R�RR&R�trepl((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR%Es
$(R+R,R%(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR(CstSaltRaetStatsEventerMinioncB@seZd�ZRS(cC@s�|dd\}}}||jjjkr0dS|j|jd��}|dkrXdSi||dfd6|jjj|jjjdfd6}i|d6|jd�d6|d6}|jjj||jjj	|��|jjj
�dS(uc
        Forward a stats message to all subscribed yards
        Stats message has a route
        urouteusrcNutagu
event_fireudstudata(R�RR�R'RRCR'R�R�R
R�(R$R�RR
RR&R�R)((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR%\s%$(R+R,R%(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*ZstSaltRaetPublishercB@s~eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6Zd	�Zd
�Z	RS(uL
    Publish to the minions
    FloScript:

    do salt raet publisher

    u
.salt.optsuoptsu.salt.var.publishupublishu.salt.road.manor.stackustacku.salt.var.presence.availablesu
availablesc	C@s�|jj}|d}|jjtd�t|jj��D��@}x�|D]�}|jjj|�}|rLi|ddfd6|jjj	j
ddfd6}i|d6|dd6}|jjj||�qLqLWdS(	uA
        Publish the message out to the targeted minions
        ureturncs@s9|]/}|jtjjtjjgkr|jVqdS(N(RNRORPR�R�R'(RRT((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pys	<genexpr>�sufunudstusrcurouteupubN(RHRR�R�RKRLRMR
RCRoR'R(	R$tpub_msgRHtpub_dataRR�R^R�R�((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt_publishs
	&
cC@s0x)|jjr+|j|jjj��qWdS(uA
        Pop the publish queue and publish the requests!
        N(R�RR.R�(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(
R+R,R-R.R/R0R1R2R.R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR+qs	tSaltRaetSetupEnginescB@sIeZdZiejjjd�d6ejjjd�d6Zd�ZRS(u
    Start the engines!
    u
.salt.optsuoptsu.salt.usr.proc_mgruproc_mgrcC@s#tjj|jj|jj�dS(uF
        Only call once, this will start the engine processes
        N(R.tenginest
start_enginesRRR>(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR/�stSaltRaetSetupBeaconcB@s_eZdZiejjjd�d6ejjjd�d6ejjjd�d6Zd�ZRS(u%
    Create the Beacon subsystem
    u
.salt.optsuoptsu.salt.beaconubeaconu.salt.loader.modulesumodulescC@s+tjj|jj|jj�|j_dS(u!
        Run the beacons
        N(R.tbeaconstBeaconRRR�tbeacon(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s		(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR2�s
tSaltRaetBeaconcB@s�eZdZiejjjd�d6ejjjd�d6ejjjd�d6ejjjd�d6ejjjd	�d
6Zd�ZRS(u
    Run the beacons
    u
.salt.optsuoptsu.salt.loader.modulesumodulesu.salt.var.master_eventsu
master_eventsu.salt.event.eventsueventu.salt.beaconubeaconcC@s�d|jjkr�|jjdd�}|r�y?|jjj|�}|jjj|�|jjj|�Wq�tk
r�tj	ddt
�q�Xq�ngS(u!
        Run the beacons
        uconfig.mergeubeaconsuError in the beacon system: texc_info(R�RR5R<t
master_eventstextendR�t	ExceptionRlRmRz(R$tb_conftevents((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s
(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR6�stSaltRaetMasterEventscB@sheZdZiejjjd�d6ejjjd�d6ejjjd�d6Zd�Zd�Z	RS(	u^
    Take the events off the master event que and send them to the master to
    be fired
    u
.salt.optsuoptsu.salt.road.manor.stacku
road_stacku.salt.var.master_eventsu
master_eventscC@st�|j_dS(N(RR8R(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyRZ�scC@s|jjsdSg}x|jjjD]}|}q&Wx)|jjra|j|jjj��q9Wi|jjjjddfd6t	t
|jjjj���jddfd6}i|jjdd6|d6dd6}|jjj
i|d6|d	6d
|�dS(Nusrcu
remote_cmdudstuidueventsu
_minion_eventucmdurouteuloadR^(R8RR�RLR�R�RoR'RCRRKRMRR�(R$R<RQt
master_uidR�RI((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s
1
 (
R+R,R-R.R/R0R1R2RZR*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR=�s	tSaltRaetSetupMatchercB@s_eZdZiejjjd�d6ejjjd�d6ejjjd�d6Zd�ZRS(u!
    Make the matcher object
    u
.salt.optsuoptsu.salt.loader.modulesumodulesu
.salt.matcherumatchercC@s+tjj|jj|jj�|j_dS(N(R.R�tMatcherRRR�tmatcher(R$((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR*�s		(	R+R,R-R.R/R0R1R2R*(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyR?�s
(kR-t
__future__RRRRR�R�tloggingR�tcollectionsRt_socketRtsalt.daemons.masterapiR.tsalt.utils.argstsalt.utils.kindsR/ROtsalt.utils.processtsalt.utils.stringutilstsalt.transporttsalt.enginestraetRtraet.road.stackingRtraet.road.estatingRtraet.lane.stackingRR	tsalt.daemonsR
tsalt.exceptionsRtsalt.utils.platformRtsalt.utils.eventR
tioflo.aid.odictingRtioflo.base.deedingtioflotioflo.base.consolingRRR9R�tsalt.utils.psutil_compatt
psutil_compatR�RztImportErrorR�R�tsalt.extRtsalt.ext.six.movesRt	getLoggerR+RltbasetdeedingtDeedRR3R;R?RERGRUR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRRRR$R(R*R+R/R2R6R=R?(((s9/usr/lib/python2.7/site-packages/salt/daemons/flo/core.pyt<module>s�	



(
f? # MD:!V_��<K(-

Zerion Mini Shell 1.0