%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/client/ssh/wrapper/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyc

�
���^c@@s�dZddlmZmZddlZddlZddlZddlZddl	Zddl
mZdefd��YZ
dS(s
The ssh client wrapper system contains the routines that are used to alter
how executions are run in the salt-ssh system, this allows for state routines
to be easily rewritten to execute in a way that makes them do the same tasks
as ZeroMQ salt, but via ssh.
i(tabsolute_importtprint_functionN(tsixtFunctionWrappercB@sMeZdZddddddd�Zd�Zd�Zd�Zd�ZRS(s
    Create an object that acts like the salt function dict and makes function
    calls remotely via the SSH shell system
    c
K@s�tt|�j�||_t|t�r1|ni|_||_t|t�rX|ni|_i|d6|d6|_	||_
|j	j|
�||_|jdkr�i|_n|	|_dS(Ntid_thost(tsuperRt__init__t
cmd_prefixt
isinstancetdicttwfuncstoptstmodstkwargstfsclienttupdatetaliasestNonetminion_opts(tselfRRRRR
RRRRR((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyRs		

		cC@s)y||tSWntk
r$tSXdS(s�
        We need to implement a __contains__ method, othwerwise when someone
        does a contains comparison python assumes this is a sequence, and does
        __getitem__ keys 0 and up until IndexError
        N(tTruetKeyErrortFalse(Rtkey((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyt__contains__6s

c@s�d�kr��jr�tj�j�}|jd�}|jd�}t�j||d�jd�jd�j	d�d�j
d	�j|�S�jr�d
j�j���n��jkr��j�S��j
kr��j
�S��fd�}|S(sS
        Return the function call to simulate the salt local lookup system
        t.RRRR
RRRRs{0}.{1}c@s��g}|jg|D]}tjjj|�^q�|jgtj|�D]<\}}djtjjj	|�tjjj|��^qN�tj
jj�j
|d�jdtd�jd�j�j�}|j�\}}}	|jd�ridd6|d6|d	6|	d
6SyVtjjj|�}
t|
�dkrZd|
krZ|
d}
n|
jd
i�}
Wn3tk
r�idd6|d	6|d6|	d
6}
nX|
S(s7
            The remote execution function
            s{0}={1}R
tdisable_wipeRRsPermission Deniedt_errortstdouttstderrtretcodeitlocaltreturnsFailed to return clean data(textendtsalttutilstjsontdumpsRt	iteritemstformattstringutilstto_strtclienttsshtSingleRR
RRRRt	cmd_blocktcounttloadstlentgett
ValueError(targsRtargvtargRtvaltsingleRRRtret(tcmdR(sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pytcalleres<	/P		



(
RtcopytdeepcopyRtpopRRRR
RRRR((RR:RRRR;((R:RsD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyt__getitem__Bs,						%cC@sd|kr.|jr.tdj|���n|jrOdj|j|�}n||jkrn||j|<n||j|<dS(s+
        Set aliases for functions
        Rs6Cannot assign to module key {0} in the FunctionWrappers{0}.{1}N(RRR(RR(RR:tvalue((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyt__setitem__�s		cC@s||kr||S|SdS(s.
        Mirrors behavior of dict.get
        N((RR:tdefault((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyR2�sN(	t__name__t
__module__t__doc__RRRR?RAR2(((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyRs		J	(REt
__future__RRR<tsalt.loaderR#tsalt.utils.datatsalt.utils.jsontsalt.client.sshtsalt.extRtobjectR(((sD/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/__init__.pyt<module>s

Zerion Mini Shell 1.0