%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s	dZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlmZddlmZddlmZeje�Zdejejefd��YZd	efd
��YZdS(u#
Execute salt convenience routines
i(tabsolute_importtprint_functiontunicode_literalsN(tmixins(tdisplay_output(t
verify_funtRunnerClientcB@skeZdZdZdZd�Zed��Zd�Zd�Z	d	ed�Zd	d	d	e
ed�ZRS(
u7
    The interface used by the :command:`salt-run` CLI tool on the Salt Master

    It executes :ref:`runner modules <all-salt.runners>` which run on the Salt
    Master.

    Importing and using ``RunnerClient`` must be done on the same machine as
    the Salt Master and it must be done using the same user that the Salt
    Master is running as.

    Salt's :conf_master:`external_auth` can be used to authenticate calls. The
    eauth user must be authorized to execute runner modules: (``@runner``).
    Only the :py:meth:`master_call` below supports eauth.
    urunneruruncC@s||_i|_dS(N(toptstcontext(tselfR((s//usr/lib/python2.7/site-packages/salt/runner.pyt__init__,s	cC@s�t|d�s�t|d�s9tjj|j�|_ny.tjj|jd|jd|j�|_Wq�tk
r�tjj|jd|j�|_q�Xn|jS(Nu
_functionsuutilstutilsR(	thasattrtsalttloaderRRtrunnerRt
_functionstAttributeError(R	((s//usr/lib/python2.7/site-packages/salt/runner.pyt	functions0s	%
	c
	C@s9|jd�}t|j|�tgdddddddgD]'}||kr>||j|�f^q>�}tjjj|jd	g�d
t�\}}|j	|jdi��|j	|�g}|j
|�|jtdt|��tj
j|j||d
t�\}}	td|di|	d6|d	6|�S(u�
        Format the low data for RunnerClient()'s master_call() function

        This also normalizes the following low data formats to a single, common
        low data structure.

        Old-style low: ``{'fun': 'jobs.lookup_jid', 'jid': '1234'}``
        New-style: ``{'fun': 'jobs.lookup_jid', 'kwarg': {'jid': '1234'}}``
        CLI-style: ``{'fun': 'jobs.lookup_jid', 'arg': ['jid="1234"']}``
        ufunuusernameupasswordueauthutokenuclientuuserukeyuargt	conditionukwargt	__kwarg__tignore_invalidtfuntkwarg(tpopRRtdictR
Rtargstparse_inputtFalsetupdatetextendtappendtTruetminiontload_args_and_kwargs(
R	tlowRtiteauth_credst_argt_kwargtmungedtargR((s//usr/lib/python2.7/site-packages/salt/runner.pyt
_reformat_lowAs$*!

	
cC@s"|j|�}tjj||�S(u�
        Execute a runner function asynchronously; eauth is respected

        This function requires that :conf_master:`external_auth` is configured
        and the user is authorized to execute runner functions: (``@runner``).

        .. code-block:: python

            runner.eauth_async({
                'fun': 'jobs.list_jobs',
                'username': 'saltdev',
                'password': 'saltdev',
                'eauth': 'pam',
            })
        (R*RtAsyncClientMixint	cmd_async(R	R#treformatted_low((s//usr/lib/python2.7/site-packages/salt/runner.pyR,lscC@s(|j|�}tjj||||�S(u�
        Execute a runner function synchronously; eauth is respected

        This function requires that :conf_master:`external_auth` is configured
        and the user is authorized to execute runner functions: (``@runner``).

        .. code-block:: python

            runner.eauth_sync({
                'fun': 'jobs.list_jobs',
                'username': 'saltdev',
                'password': 'saltdev',
                'eauth': 'pam',
            })
        (R*RtSyncClientMixintcmd_sync(R	R#ttimeouttfull_returnR-((s//usr/lib/python2.7/site-packages/salt/runner.pyR/�scC@s%tt|�j||||||�S(u$
        Execute a function
        (tsuperRtcmd(R	RR)tpub_dataRtprint_eventR1((s//usr/lib/python2.7/site-packages/salt/runner.pyR3�sN(t__name__t
__module__t__doc__tclientt
tag_prefixR
tpropertyRR*R,tNoneRR/R R3(((s//usr/lib/python2.7/site-packages/salt/runner.pyRs		+	tRunnercB@s)eZdZd�Zd�Zd�ZRS(u+
    Execute the salt runner interface
    cC@sJtt|�j|�tjj||j�|_tjj|�|_dS(N(R2R=R
R
Rt	returnersRt
outputters(R	R((s//usr/lib/python2.7/site-packages/salt/runner.pyR
�scC@sr|jjdd�}tt|�j|�}x>t|�D]0}tdj|�d|j�t	||�q:WdS(u.
        Print out the documentation!
        ufunu{0}:utextN(
RtgetR<R2R=tget_docstsortedRtformattprint(R	R)tdocsR((s//usr/lib/python2.7/site-packages/salt/runner.pyt
print_docs�s
cC@s�ddl}i}|jjdt�r4|j�n�i|jdd6}y�|j�}|d|_|jjj	|jdd|jjdg��}t
|j|d�|jj
|j|d|�\}}||d<||d	<|jjd
�rkd|jkr�yZ|jjjtjj|jdd
�d��&}|jjj|j��|d<WdQXWq�tk
r�|jd|d<q�Xnd|kr}d|kr}|jd
r}ddl}|jj|j�}	|	j|jd
�}
|jdr0|
r0|	j|jd
|
�}|r0|jdd�|d<q0n|
sGtjd�|S|j|
�|jd
|d
<q}n|jjj �}|dd-kr�|d|d	d<n|jjdt�r|jjd
�r�|j!|�}n%|j"|jd|d|d|�}tj#d|d�|dS|jjd
�r�|j$|�}t%|t&�r{t'|�ddhkr{|d}
|d}nd}
t)||
|j�n0|j*|jd|||d|ddt�}Wn|j+j,k
r�}|jj-j.dd |j�}|j/itd!6d"j0|�d#6d$d%6|jdd6|d&6|jd6d'd(j0|j��d|kr�|j1d)j0|d��}nd}|s�d"j0|�}n|jjd*t�s�t)|d+|j�q�nXtj2d,|�|SdS(.u-
        Execute the runner sequence
        iNudocufunujiduargtno_parseuno_parseukwargueauthutokenucachediru	.root_keyurukeyumktokenuuAuthentication failedustate.orchestrateu
state.orchu	state.slsuorchestration_jiduasynctusertpubu�Running in asynchronous mode. Results of this execution may be collected by attaching to the master event bus or by examing the master job cache, if configured. This execution is running under tag %sutagudatau	outputtert	daemonizeumasterRusuccessu{0}ureturni�uretcodeufun_argsttagusalt/run/{0}/retu{0}*uquietunesteduRunner return: %s(ustate.orchestrateu
state.orchu	state.sls(3tsalt.minionRR@RRFt_gen_async_pubtjidRRRRRR!R"tfilestfopentostpathtjointstringutilst
to_unicodetreadlinetIOErrort	salt.authtauthtResolvertclit	token_clitlogterrorRRHtget_specific_userR,tasynchronoustwarningR/t
isinstanceRtsetR<Rt_proc_functiont
exceptionst
SaltExceptionteventt	get_eventt
fire_eventRCRAtdebug(R	R
tretR#t	async_pubtfun_argsRtkwargstfp_tresolvertresttokRHt	outputtertexctevt((s//usr/lib/python2.7/site-packages/salt/runner.pytrun�s�


	

1)
%
	

	'




(R6R7R8R
RFRv(((s//usr/lib/python2.7/site-packages/salt/runner.pyR=�s		(R8t
__future__RRRRQtloggingtsalt.exceptionsR
tsalt.loaderRLtsalt.utils.argstsalt.utils.eventtsalt.utils.filestsalt.utils.usertsalt.clientRtsalt.outputRtsalt.utils.lazyRt	getLoggerR6R]R.R+tobjectRR=(((s//usr/lib/python2.7/site-packages/salt/runner.pyt<module>s "�

Zerion Mini Shell 1.0