KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/sos/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/sos/helpers.pyo
mò
Ýl2Wc@sÍdZdkZdkZdkZdkZdkZdkZdklZdkl	Z	dk
lZlZl
Z
d„Zd„Zd„Zd„Zd	„Zd
„Zd„Zeiieiid„ZdS(
s0
helper functions used by sosreport and plugins
N(stime(smkdtemp(sPopensPIPEsSTDOUTcCsIy"t|tƒtƒ|gƒ}Wntj
odSnXt||ƒS(s9 Import a plugin to extend capabilities of sosreport
    N(	t
__import__t
pluginnametglobalstlocalstnametplugintImportErrortNonetgetattr(RRR((t//usr/lib/python2.4/site-packages/sos/helpers.pytimportPlugin!s"	cCsLy:tii|ƒpti|ƒntdd|ƒ}WndSnX|S(sYFind a temp directory to form the root for our gathered information
    and reports.
    ttsos_N(tostpathtisdirttmpdirtmkdirtmkdtemptworkingBaseR(RR((R	t
sosFindTmpDir+scCsmti|tiƒ}y!ti|ti|tiBƒWn0tj
o$ti|ti|tiBƒnXdS(sE Make the file descriptor non-blocking. This prevents deadlocks.
    N(	tfcntltafdtF_GETFLtfltF_SETFLR
tO_NDELAYtAttributeErrortFNDELAY(RR((R	tmakeNonBlocking8s!cCsŽtƒ}ti}d|d<t|dtdtdt	ddd|ƒ}|iƒ\}}|dd	jo|d }n|i|tƒ|fS(sD Execute a command and gather stdin, stdout, and return status.
    tCtLC_ALLtshelltstdouttstderrtbufsizeiÿÿÿÿtenvs
N(ttimetstimeR
tenvirontcmd_envtPopentcommandtTruetPIPEtSTDOUTtptcommunicateR!R"t
returncode(R*R!R(R.R&R"((R	tsosGetCommandOutputBs		
cCs&|p	dGHndGHtiiƒdS(se Complete a status line that has been output to the console,
    providing pass/fail indication.
    s    [   OK   ]s    [ FAILED ]N(tstattsysR!tflush(R2((R	t	sosStatusSs	
cCs8|d}x'|dD]}||jotSqqWtS(s= return True if all the elements are equal, otherwise False. iiN(telementst
first_elementt
other_elementtFalseR+(R6R7R8((R	tallEqual_s

cGs‡|pggfSng}x:ti|ŒD])}t|ƒpPn|i|dƒq+W|g}|D]}||t	|ƒqf~fS(sŠ return a list of common elements at the start of all sequences,
        then a list of lists that are the unique tails of each sequence. iN(
t	sequencestcommont	itertoolstizipR6R:tappendt_[1]tsequencetlen(R;R6RAR@R<((R	tcommonPrefixhs
cCsxy1t|i|ƒ|i|ƒƒ\}\}}Wntj
o|SnX|p|Sn|i	|gt|ƒ|ƒS(sÅ return a relative path from path1 equivalent to path path2.
        In particular: the empty string, if path1 == path2;
                       path2, if path1 and path2 have no common prefix.
    N(RCtpath1tsplittseptpath2R<tu1tu2RtjointpardirRB(RDRGRFRKRHRIR<((R	t
sosRelPathys1	(t__doc__R
RtselectR=R3tcommandsR%ttempfileRt
subprocessR)R,R-R
RRR1R5R:RCRRFRKRL(RR,RORCRR-R
R)R5R3R=RR%RLR1R:R
RNR((R	t?s6

	
	
	
					

Anon7 - 2021