%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/utils/debug.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZ
ddlZ
d�Zd�Zd�Zd�Zd�Zd	�Zd
�Zded�ZdS(
u6
Print a stacktrace when sent a SIGUSR1 for debugging
i(tabsolute_importtprint_functiontunicode_literalsNcC@s1|jd�tj|d|�|jd�dS(u
    Pretty print the stack trace and environment information
    for debugging those hard to reproduce user problems.  :)
    u*======== Salt Debug Stack Trace =========
tfileu*=========================================
N(twritet	tracebacktprint_stack(tprintouttstack((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pyt_makeprettys
cC@s�tjj�r(tj}t||�nddjttj���}tjj	t
j�|�}tj
jj|d��}t||�WdQXdS(uI
    Signal handler for SIGUSR1, only available on Unix-like systems
    usalt-debug-{0}.loguwN(tsyststderrtisattyR	tformattintttimetostpathtjointtempfilet
gettempdirtsalttutilstfilestfopen(tsigRtoutputtfilenametdestfile((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pyt_handle_sigusr1s	cC@s�yddl}Wntk
r$dSX|j�r�|j�djttj��tj��}tj	j
tj�|�}|j
�j|dd�tjj�r�tjjdj|��n|j�n,tjj�r�tjjd�n|j�dS(uI
    Signal handler for SIGUSR2, only available on Unix-like systems
    iNucallgrind.salt-{0}-{1}ttypeu	CALLGRINDuSaved profiling data to: {0}
uProfiling started
(tyappitImportErrort
is_runningtstopR
RRRtgetpidRRRRtget_func_statstsaveR
RRRtclear_statststart(RRRRR((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pyt_handle_sigusr2/s

$
cC@s/tt|�r+tjtt|�|�ndS(uK
    Add signal handler for signal name if it exists on given platform
    N(thasattrtsignaltgetattr(tsignal_namethandler((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pytenable_sig_handlerEscC@stdt�tdt�dS(u�
    Pretty print a stack trace to the console or a debug log under /tmp
    when any of the salt daemons such as salt-master are sent a SIGUSR1
    uSIGUSR1uSIGINFON(R.R(((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pytenable_sigusr1_handlerMs
cC@stdt�dS(u
    Toggle YAPPI profiler
    uSIGUSR2N(R.R((((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pytenable_sigusr2_handlerXscC@sitj�ddd6S(u@
    Return a string of which function we are currently in.
    iiuco_name(tinspectR(((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pyt
inspect_stack_sic
C@s-tj�}d|}t|�|dkr0dS||d}g}|tkryytj|�j}Wqyd}qyXntj|�}|r�|j|j	�nd|j
kr�|j|j
djj	�n|jj
}|dkr�|j|�n~dj|�}	|r)|r)|	dj|�7}	n|	S(	uU
    Get a name of a caller in the format module.class.method

    `skip` specifies how many levels of stack to skip while getting caller
    name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.

    An empty string is returned if skipped levels exceed stack height

    Source: https://gist.github.com/techtonik/2151727
    iiuuselfu<module>u.u:{}N(R1RtlentTruetgetframeinfotlinenotNonet	getmoduletappendt__name__tf_localst	__class__tf_codetco_nameRR
(
tskiptinclude_linenoRR'tparentframetnameR6tmoduletcodenametfullname((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pytcaller_namefs0

(t__doc__t
__future__RRRRR
RR*RRR1tsalt.utils.filesRtsalt.utils.stringutilsR	RR(R.R/R0R2tFalseRF(((s4/usr/lib/python2.7/site-packages/salt/utils/debug.pyt<module>s$	
						

Zerion Mini Shell 1.0