%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddl
Z
ddl
mZddlmZmZmZddladdljjZe	je�Zedd�Zd�Zd	�Zd
�Zd�Z d�Z!d
�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Z.dS(uI
This module contains the function calls to execute command line scripts
i(tabsolute_importtprint_functiontunicode_literalsN(trandint(tSaltSystemExittSaltClientErrortSaltReqTimeoutErrorucC@s/|r%|rtj|�n|�n|�dS(u�
    if hardfailing:
        If we got the original stacktrace, log it
        If all cases, raise the original exception
        but this is logically part the initial
        stack.
    else just let salt exit gracefully

    N(tlogterror(texctoriginal_excthardfailttrace((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt_handle_interrupts

	cC@s�ytj�}Wntk
r)d}nXy|jj}Wnttfk
rYt}nX|tjkr�d}y'|j	j
d}|dj|�7}Wq�ttfk
r�q�Xnd}t
t|�td�|d|�dS(Nuu
Exiting gracefully on Ctrl-cujidu�
This job's jid is: {0}
The minions may not have all finished running and any remaining minions will return upon completion. To look up the return data for this job later, run the following command:

salt-run jobs.lookup_jid {0}u"
Exiting with hard crash on Ctrl-cR(t	tracebackt
format_exctAttributeErrortoptionst
hard_crashtKeyErrortFalsetsignaltSIGINTtlocal_clienttpub_datatformattNoneR
t
SystemExitt	Exception(tclienttsignumtsigframeRt	hardcrashtexit_msgtjid((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt_handle_signals.s,


		cC@s~tjtj�tjkr=tjtjtjt|��ntjtj�tjkrztjtjtjt|��ndS(N(Rt	getsignalRtSIG_DFLt	functoolstpartialR#tSIGTERM(R((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt_install_signal_handlersQs"cC@sUddl}tjr5ddlm}|dd�n|jjj�}|j�dS(u 
    Start the salt master.
    iN(t
warn_untiluSodiumu�Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date.  Salt will drop support for Python 2.7 in the Sodium release or later.(	tsalt.cli.daemonstsixtPY2tsalt.utils.versionsR*tclitdaemonstMastertstart(tsaltR*tmaster((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_master\s	
c@s�ddl�ddl�ddl��jjjd�d�}tj����fd�}zMy�jjj	�s�tj
d|dtj�f�}|j
�n�jjj�}tjtjtj||��|j
�Wn�tttfk
r�}�jdt�tjd	d
t�tjd�d}|dk	rdt|d
�rd|jjdd�}nt d|�}tj!d|�t"j#|�t$j%�j&j'j(�nXWd�jdt�XdS(u 
    Start a minion process
    iNu	KeepAlivecS@s|jj�dS(N(tminiontreload(tmanagertsigtframe((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt
handle_hup{sc@s�x��jdt�r��j�tjd�y<tj�dkrg�jjj	�rgtj
|d�nWqtk
r�}tj
d|�tj�jjj�qXqWdS(u�
        Have the minion suicide if the parent process is gone

        NOTE: small race issue where the parent PID could be replace
        with another process with same PID!
        tblockingiiu(Minion process encountered exception: %sN(tacquireRtreleasettimetsleeptostgetuidtutilstplatformt
is_windowstkilltOSErrorRRt_exittdefaultst	exitcodest
EX_GENERIC(t
parent_pidR	(tlockR3(s0/usr/lib/python2.7/site-packages/salt/scripts.pytsuicide_when_without_parent�s

%ttargettargsR<u4Fatal functionality error caught by minion handler:
texc_infou** Restarting minion **i<uconfigurandom_reauth_delayiuwaiting random_reauth_delay %ss()tsalt.utils.platformtsalt.utils.processR+RCtprocesstappendproctitlet	threadingtRLockRDREtThreadRAtgetppidR2R/R0tMinionRtSIGHUPR&R'RRRR=tTrueRtwarningRthasattrtconfigtgetRtinfoR?R@tsystexitRIRJtSALT_KEEPALIVE(R;RNtthreadR6R	tdelay((RMR3s0/usr/lib/python2.7/site-packages/salt/scripts.pytminion_processos:	!
	


cC@s�ddl}ddl}ddl}|jjj�ddl}ddl}dtj	krntj	j
d�n|jjj�r�|j
jj�}|j�dStjr�ddlm}|dd�ndtjkrtjj
d�|j
jj�}|j�dSd�}|j|j�}|j|j�}xmtr�y�|jd	t�}|j�|j|jtj||j��|j|jtj||j��|j|jtj||j��Wn.t k
r�|j
jj�}|j�PnX|j!�|j|j|�|j|j|�|j"|j#j$j%ksPtj&|j"�nt'j(d
t)dd��t*j+�}	x|	j,D]}
|	j-|
�q�Wt*j.�q8WdS(
uR
    Start the salt minion in a subprocess.
    Auto restart minion on error.
    iNu(R*uSodiumu�Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date.  Salt will drop support for Python 2.7 in the Sodium release or later.u--disable-keepalivecS@stj||�dS(uy
        Escalate the signal received to the multiprocessing process that
        is actually running the minion
        N(RARF(tpidRR((s0/usr/lib/python2.7/site-packages/salt/scripts.pytescalate_signal_to_process�sROiii
(/RRRRSRCRTtnotify_systemdR+tmultiprocessingRbtpathtremoveRDRER/R0RZR2R,R-R.R*targvR$RR(R\tProcessRgR&R'RhR[RtjointexitcodeRIRJRdRcR?R@Rtloggingt	getLoggerthandlerst
removeHandlertbasicConfig(RR3RkR6R*Ritprev_sigint_handlertprev_sigterm_handlerRTtrloggerthandler((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_minion�sf
	

			
	
	
	


c
@s�ddl}ddl}tj���fd�}z�y{|jjj�sytjd|dtj	�f�}|j
�nt}d}|j
jj}|jjj�}|j
�Wnhttttfk
r�}tjddt�t}|j
jj}n"tk
r}t}|j}nXWd�jdt�X|tkr�tjd	�d
}|dk	r�t|d�r�|j j!dd
�}q�nt"d
|�}	tj#d|	�|j$|	�n
|j$d�t%j&|�dS(u&
    Start a proxy minion process
    iNc@sixb�jdt�rd�j�tjd�ytj|d�Wqtk
r`tjd�qXqWdS(u�
        Have the minion suicide if the parent process is gone

        NOTE: there is a small race issue where the parent PID could be replace
        with another process with the same PID!
        R<iii�N(	R=RR>R?R@RARFRGRH(RL(RM(s0/usr/lib/python2.7/site-packages/salt/scripts.pyRNs


RORPuProxy Minion failed to start: RQR<u** Restarting proxy minion **i<uconfigurandom_reauth_delayiu*Sleeping random_reauth_delay of %s seconds('R+RRRVRWRCRDRERXRARYR2RRRIRJtEX_OKR/R0tProxyMinionRRRRRRR\RdRtcodeR=R]R^R_R`RRatputRbRc(
tqueueR3RNRetrestarttproxyminiontstatusR	Rftrandom_delay((RMs0/usr/lib/python2.7/site-packages/salt/scripts.pytproxy_minion_processsB!


cC@s�ddl}ddl}ddl}dtjkrFtjjd�n|jjj�rx|j	j
j�}|j�dSdtj
kr�tj
jd�|j	j
j�}|j�dSx9tr�y|j�}Wn.tk
r|j	j
j�}|j�dSX|jdtd|f�}|j�y}|j�y|jdt�}Wn*tk
ru|jdkrlPnd}nX|dkr�tj|j�ntj|�Wntk
r�PnXtj�}x|jD]}|j|�q�Wtj�q�WdS(	u
    Start a proxy minion.
    iNuu--disable-keepaliveRORPtblocki<( R+RRRkRbRlRmRCRDRER/R0R}R2RnR\tQueueRRoR�RpR`RRqRcR?R@tKeyboardInterruptRrRsRtRuRv(R3RkR�R�RTt
restart_delayRyRz((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt
salt_proxyEsP

	






cC@s|ddl}|jjj�ddl}tj�}y |jjj	�}|j
�Wn!tk
rwtj|d�nXdS(u 
    Start the salt syndic.
    iNi(
RSRCRTRjR+RAtgetpidR/R0tSyndicR2R�RF(R3Rhtsyndic((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_syndic}s
cC@siddl}y*|jjj�}t|�|j�Wn,tk
rd}tjj	dj
|��nXdS(u7
    Manage the authentication keys with salt-key.
    iNuError: {0}
(tsalt.cli.keyR/tkeytSaltKeyR)trunRRbtstderrtwriteR(R3Rterr((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_key�s
cC@s6ddl}|jjj�}t|�|j�dS(uV
    Publish commands to the salt system from the command line on the
    master.
    iN(tsalt.cli.cpR/tcpt	SaltCPCliR)R�(R3R((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_cp�s
cC@sXddl}dtjkr.tjjd�n|jjj�}t|�|j�dS(ui
    Directly call a salt command in the modules, does not require a running
    salt minion to run.
    iNu(	t
salt.cli.callRbRlRmR/tcalltSaltCallR)R�(R3R((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt	salt_call�s
cC@sXddl}dtjkr.tjjd�n|jjj�}t|�|j�dS(u-
    Execute a salt convenience routine.
    iNu(tsalt.cli.runRbRlRmR/R�tSaltRunR)(R3R((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_run�s
cC@s�ddl}dtjkr.tjjd�ny*|jjj�}t|�|j�Wnkt	k
r�}t
j�}y|jj
}Wnttfk
r�t}nXtt|�||d|�nXdS(u%
    Execute the salt-ssh system
    iNuR(tsalt.cli.sshRbRlRmR/tsshtSaltSSHR)R�RRRRRRRRR
R(R3RR�RR ((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_ssh�s"

	cC@s�yddladdlaWnCtk
ra}tjd|�td�tjtj	j
j�nXdtjkr�tjj
d�ntjjj�}t|�|j�dS(u*
    The main function for salt-cloud
    iNuError importing salt cloud: %su*salt-cloud is not available in this systemu(t
salt.cloudR3tsalt.cloud.clitImportErrorRRtprintRbRcRIRJtEX_UNAVAILABLERlRmtcloudR/t	SaltCloudR)R�(teR((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt
salt_cloud�s

cC@sHddl}|jjj�ddl}|jjj�}|j�dS(u(
    The main function for salt-api
    iN(	RSRCRTRjtsalt.cli.apiR/tapitSaltAPIR2(R3tsapi((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_api�s
cC@sXddl}dtjkr.tjjd�n|jjj�}t|�|j�dS(uV
    Publish commands to the salt system from the command line on the
    master.
    iNu(	t
salt.cli.saltRbRlRmR/R3tSaltCMDR)R�(R3R((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt	salt_main�s
cC@s,ddl}|jjj�}|j�dS(u]
    The main function for spm, the Salt Package Manager

    .. versionadded:: 2015.8.0
    iN(tsalt.cli.spmR/tspmtSPMR�(R3R�((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_spmscC@s>ddl}|jjjd|d|d|d|d|�dS(ub
    Quickstart for developing on the saltstack installation

    .. versionadded:: 2016.11.0
    iNt	extensiontnametdescriptiontsalt_dirtmerge(tsalt.utils.extendRCtextendR�(R�R�R�R�R�R3((s0/usr/lib/python2.7/site-packages/salt/scripts.pytsalt_extends(/t__doc__t
__future__RRRRARbR?RRrR&RVRtrandomRtsalt.exceptionsRRRtsalt.defaults.exitcodesR3tsalt.ext.sixtextR,Rst__name__RRR
R#R)R5RgR{R�R�R�R�R�R�R�R�R�R�R�R�R�(((s0/usr/lib/python2.7/site-packages/salt/scripts.pyt<module>sF	#			>	X	@	8		
		
					
	

Zerion Mini Shell 1.0