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/setroubleshoot/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/setroubleshoot/util.pyc
m
3Uc&@sdddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g&Zd&kZd&kZd&kZd&kZd&kZd&kZd&kZd&kZd&k	Z	d&k
Z
d&kZd&kZ
d&kZd&kZd&kZd'kTd(klZd'kTd'kTd)Zd*Zd+ZeiZe
id,Ze
id-Ze
id.Ze
id/Ze
id0Z d1Z!d2Z"d3Z#d4Z$d5Z%d&d&d6Z'd7Z(d8d9d:Z)d9d*d;Z*d<d=Z+d>Z,d?Z-d@Z.dAZ/dBZ0dCZ1dDZ2dEZ3dFZ4dGZ5dHZ6dIZ7dJZ8dKZ9d&dLZ:dMZ;d&dNZ<dOZ=d&dPZ>dQZ?d&dRZ@dSZAdTZBdUZCdVZDeiEdWeiFZGeiHoeiEdWeiIZJneGZJeJeGZKeiEd*ZLeiEdXdYZMdZeiNfd[YZOd\eiNfd]YZPd$fd^YZQd%eiRfd_YZSeiTeSd&S(`taudit_msg_decodetmerge_liststpreextend_listtfmt_objtformat_elapsed_timetformat_2_column_name_valuet	wrap_textt
format_msgtremove_linebreakstdefault_texttdefault_date_texttget_standard_directoriestget_rpm_nvr_from_headertget_rpm_nvr_by_nametget_rpm_nvr_by_file_pathtget_rpm_nvr_by_name_temporaryt"get_rpm_nvr_by_file_path_temporarytis_hext
split_rpm_nvrtget_user_home_dirtget_plugin_namestload_pluginstget_os_environmenttfind_programtget_identitytget_hostnametmake_database_filepathtvalid_email_addresstlaunch_web_browser_on_urltabstracttget_error_from_socket_exceptiont!assure_file_ownership_permissionstparse_datetime_offsettDATABASE_MAJOR_VERSIONtDATABASE_MINOR_VERSIONtdatabase_version_compatiblet	TimeStamptRetryN(t*(s
get_configiis/etc/redhat-releases\s*
+\s*s^[A-Fa-f0-9]+$s<a\s*href="([^"]+)"[^<]*</a>s^([^\s@]+)@([^\s@]+)$s^\s*"([^"]+)"\s*$cCsd}}|id}t|djot|d}nt|djot|d}n|tjot	i
d|tttSn&t
ot	i
d|ttntSdS(Nt.iiis=database version %s not compatible with current %d.%d versions9database version %s compatible with current %d.%d version(tNonetmajortminortversiontsplitt
componentstlentintR!tlog_databasetinfoR"tFalsetdebugtTrue(R+R)R-R*((t7/usr/lib/python2.4/site-packages/setroubleshoot/util.pyR#_s

	
	cCs|djodSnti|\}}t|}|d}||d}|d}||d}|d}||d}|od|||||fSn|od||||fSn|od|||fSnd||S(NiQii<s%dd:%dh:%dm:%.3fss
%dh:%dm:%.3fss	%dm:%.3fss%.3fs(telapsed_timeR(tmathtmodftfractiontwholeR/tdaysthourstminutestseconds(R6R<R=R;R>R9R:((R5Rps"



cCs ti|otSntSdS(N(thex_retmatchtstrR4R2(RA((R5RscCse|djodSnti|}|o|id}n$y|id}Wn
|}nX|S(Nithex(tmsgR(taudit_decode_retsearchR@tgrouptdecodedtdecode(RCRGR@((R5Rs

cCsj|p|Sn|p|Snh}x|D]}d||<q+Wx|D]}d||<qFW|i}|S(s2return a list containing the unique members of a+bN(tbtatdtiR(tkeystm(RJRIRKRLRN((R5RscCs|djo
g}nt|}||}|djo`t|tjo5|i	g}t|D]}||qd~q|i	|g|n|S(Ni(
t_listR(R.t
cur_lengthtrequested_lengthtdeltattypetdefaulttTypeTypetextendt_[1]trangetx(RQRORTRPRWRRRY((R5Rs



5c
Cst|tjo|Snt|tjpt|tjo>ddig}|D]}|dt|qU~dSnt|t	jod|i
}|iddig}|D]'}|dt|t||fq~dSnt
|SdS(Nt[t s%st]t{s%s=%st}(RStobjt
StringTypetListTypet	TupleTypetjoinRWRYRtDictTypeRMtsorttkeyRA(R_RMRWRfRY((R5Rs&>
NiiPcCst||jo|d|d!d}n|d|t|}|p
|io||dSn1|t_d|t_|t_	ti
|dSdS(NiiR[s
(R.tnametvalue_indenttinitial_indenttvaluetisspacettext_wrappertsubsequent_indentt
page_widthtwidthtfill(RgRjRhRnRi((R5Rs	
	cCs6d|}|t_|t_|t_ti|dS(NR[s
(tindenttprefixRlRiRmRoRpts(RsRoRqRr((R5Rs

			icCsa|djo
d}n|i}d|}|t_|t_dt_|dti
|dS(NtR[iPs
s

(RCR(tstripRqtindentStringRlRiRmRottitleRp(RwRCRqRv((R5Rs


			cCs5tid|i}|djodSn|SdS(NR[Rt(tfix_newline_retsubRARutnew_strR((RARz((R5Rs
cCs/|djodtdd}nt|S(Nt<tUnknownt>(tvalR(t_RA(R~((R5R	s
cCs%|djot|Sn|iS(N(tdateR(R	tformat(R((R5R
s
cCsqg}yPti}|iddi}x%|iD]}|i|dq:WWnt	i
dnX|S(NRgt
filesystemis&failed to get filesystem list from rpm(tlsttrpmttstdbMatchtnextthtfiFromHeaderRLtappendtlog_programt	exception(RLRRR((R5Rs
cCs/|d}|d}|d}d|||fS(s6Given an RPM header return the package NVR as a stringRgR+treleases%s-%s-%sN(thdrRgR+R(RRR+Rg((R5Rs



cCsw|djodSnd}y>dk}|idd|gd|iidi}Wnti	d|nX|S(NRs-qtstdoutis"failed to retrieve rpm info for %s(
RgR(tnvrt
subprocesstPopentPIPEtcommunicatetrstript
log_pluginR(RgRR((R5Rs
	5cCs|djodSntii|}tii|pdSnd}y>dk}|idd|gd|i	i
di}Wnti
d|nX|S(NRs-qfRis"failed to retrieve rpm info for %s(RgR(tostpathtabspathtexistsRRRRRRRR(RgRR((R5Rs
	5cCs||djodSnd}yCti}|iti|}x|D]}t	|}PqFWWnt
id|nX|S(Ns"failed to retrieve rpm info for %s(RgR(RRRRtRPMTAG_NAMEtmiRRRR(RgRRRR((R5R
"s
	cCs||djodSnd}yCti}|iti|}x|D]}t	|}PqFWWnt
id|nX|S(Ns"failed to retrieve rpm info for %s(RR(RRRRtRPMTAG_BASENAMESRRRRR(RRRRR((R5R1s
	cCsC|id}|d}|d}di|d }|||fS(Nt-ii(RR,R-RR+RcRg(RRR+R-Rg((R5R@s


cCsHti}yti|}Wntj
o
}dSnX|i	}|S(N(RtgetuidtuidtpwdtgetpwuidtpwtKeyErrorteR(tpw_dirthome_dir(RRRR((R5RHs		cCs&ti|}|otSntSdS(N(tname_at_domain_reREtaddressR@R4R2(RR@((R5RQscCs,tdd}titi|||dS(Nthelper_appstweb_browser_launcher(t
get_configRRtspawnltP_NOWAITturl(RR((R5RXscCsMt|dd}|o|d}|d}nt}t|}||fS(Ntargsii(tgetattrRR(RterrnotstrerrortERR_SOCKET_ERRORtget_strerror(RRRR((R5R\s
c	Cst}tii|pUyt|d}|iWqnt	j
o%}t}ti
d||iqnXnyti||Wn4tj
o(}t}ti
d|||inXyt|to
|}nti|d}|djo
|}nt|to
|}nti|d}ti|||WnQtj
oE}t}ti
d|ti|dti|d|inX|S(Ntwscannot create file %s [%s]scannot chmod %s to %o [%s]iscannot chown %s to %s:%s [%s]i( R4tresultRRRtfilepathtopentftcloset	ExceptionRR2RterrorRtchmodtmodetOSErrort
isinstancetownerR/RRtgetpwnamRFR(tgidtgrptgetgrnamtchownRtgetgrgid(	RRRRFRRRRR((R5Rfs6



;cCsOdk}|i|idd}|ii}td|||fdS(Niis=%s must be implemented in subclass %s or ancestor class of %s(	tinspecttgetouterframestcurrentframetmethodR_t	__class__t__name__tsubclasstNotImplementedError(R_RRR((R5Rs	cCs|djo
d}ntidd|}tdd}g}xtiti	i
||dD]^}ti	i|}|dgjoqdnti	i
ti	i|d}|i|qdW|S(	NR&s.py$Rttpluginst
plugin_dirs.pys__init__.pyi(tfilter_globR(treRyRRtplugin_namestglobRRRctptbasenametsplitexttplugin_nameR(RRRRR((R5Rs

#"cCs|i|iS(N(RYtget_priorityty(RYR((R5tsort_pluginsscCs.tdd}tii|}g}t|}t
oti
d|n|}	d}|	tijot
oti
d|	q ntidtii|||	y:ti||g\}}}ti|	|||}
Wn#tj
otid|nX|o|inx|D]}d||f}	tii|	}
|
dj	o5t
oti
d|	n|i|
iq'nyMti||g\}}}ti|	|||}
|i|
iWn#tj
otid|nX|o|iq'q'W|i t!|S(	NRRsload_plugins() names=%st__init__s%load_plugins() %s previously importedsimporting %s as %ssfailed to load %s plugins%s.%s("RRRRRtplugin_baseRRRRR3Rtmodule_nameRtsystmodulesR1Rctimptfind_moduletmod_fptmod_pathtmod_descriptiontload_moduletmodRRRtgetR(RtpluginReR(RRRRRRRRRRR((R5RsL"

cCsy ttidi}Wn(tj
oditi}nXt	i
}|d}|d}d||f}||fS(NiR[iis%s %s(Rtredhat_release_patht	readlinesRut
myplatformtIOErrorRctplatformtdistRtunametkernel_releasetcputos_desc(RRRRR((R5Rs 

cCsX|djoti}nyti|}Wntj
odSnX|d}|S(Ni(	RR(RRRRt	pwd_entryRtusername(RRR((R5Rs
	
cCsDyti}|SWn)tj
o}tid|dSnXdS(Nscannot lookup hostname: %s(tSockettgethostnamethostnameRRRtwarningR((RR((R5RscCstii|o|Sntii|}tddid}x>|D]6}tii	||}tii
|o|SqLqLWdS(Ntfix_commandtprog_search_patht:(RRtisabstprogRRR,tsearch_pathRKRcRR((RRKRRR((R5RscCsGtdd}tidd|}|d}tii||}|S(Ntdatabasetdatabase_dirs\.xml$Rts
_database.xml(
RRRRyRgtfilenameRRRcR(RgRRR((R5Rs

c	Cstid}t}d}d}d}d}|i
}x&|i|D]}	|	ot
}t|	id}
|	id}|dj	o|djo||
d7}n|djo||
d7}n|d	jo||
d
7}n|djo||
7}n|djo||
7}n|d
jo||
7}n|djo||
7}qZq^qIqIW|oJtid|d|d|d|}totid||n|Sntid|dSdS(sThe time offset may be specified as a sequence of integer unit pairs.
       Units may be one of year,month,week,day,hour,minute,second and may optionally be plural.
       Example: '2 weeks 1 day' sets the threshold at 15 days.
       s0(\d+)\s*(year|month|week|day|hour|minute|second)iiityearimtmonthitweekitdaythourtminutetsecondR;R<R=R>s)parse_datetime_offset(%s) = time delta %ss$could not parse datetime offset (%s)N(Rtcompiletdatetime_offset_reR2tfoundR;R<R=R>ttexttlowertfinditerR@R4R/RFtquantitytunitR(tdatetimet	timedeltattdR3tlog_cfgR(RR>R;R<RR
RRR=R@R((R5R sH







$R>R<it
LocalTimezonecBs,tZdZdZdZdZRS(NcCs |i|otSntSdS(N(tselft_isdsttdtt	DSTOFFSETt	STDOFFSET(RR((R5t	utcoffsetCscCs |i|otSntSdS(N(RRRtDSTDIFFtZERO(RR((R5tdstIscCsti|i|S(N(ttimettznameRRR(RR((R5R#Osc	Csd|i|i|i|i|i|i|iddf	}t	i
|}t	i|}|i
djS(Nii(RRRRR	R
RtweekdaytttR"tmktimetstampt	localtimettm_isdst(RRR'R%((R5RRs9(Rt
__module__RR!R#R(((R5RAs			tUTCcBs)tZdZdZdZdZRS(R+cCs
tidS(Ni(RR(RR((R5R]scCsdS(NR+((RR((R5R#`scCs
tidS(Ni(RR(RR((R5R!cs(RR*t__doc__RR#R!(((R5R+Zs		cBstZeZeZdZdZddZ	dZ
dZdZdZ
dZed	Zd
ZdZdZd
d
d
d
dZdZdZdedZRS(Ns%Y-%m-%dT%H:%M:%SZs%ccCs|djo|idt|_nt|tjo|i|n_t|t	jot
i
i||i|_n-t
|t
i
o
||_n
tddS(Ntlocals"must be string, float, or datetime(ttR(RtnowR2t_dtRSR`tparset	FloatTypeRt
fromtimestamptutc_tzRt	TypeError(RR.((R5Rns

cCs;t|tot|i|iSnt|i|SdS(N(RtotherR$tcmpRR0(RR6((R5t__cmp__zscCs1t|to|i|iSn|i|SdS(N(RR6R$RR0(RR6((R5t__add__scCs9t|to|i|i7_n|i|7_|S(N(RR6R$RR0(RR6((R5t__iadd__scCs1t|to|i|iSn|i|SdS(N(RR6R$RR0(RR6((R5t__sub__scCs9t|to|i|i8_n|i|8_|S(N(RR6R$RR0(RR6((R5t__isub__scCs5|otii|iSntii|iSdS(N(R-RR/Rtlocal_tzR4(RR-((R5R/scCs|ii|iS(N(RR0t
astimezoneR=(R((R5R-scCs|i|idtS(NR-(RRtiso8601_fmtR2(R((R5t__str__sc	Csati||i\	}}}	}}
}}}}ti|||	||
|d|i|_|iS(Ni(R"tstrptimeRARR?RRRR	R
RR$tyeardayR!RR4R0(RRAR	R!RRR$RRBRR
((R5R1s0icCs1|itid|d|d|d|7_dS(NR;R<R=R>(RR0RRR;R<R=R>(RR;R<R=R>((R5taddscCs,|i}||ijotSntSdS(N(RR/R0R4R2(RR/((R5t	in_futurescCs,|i}||ijotSntSdS(N(RR/R0R4R2(RR/((R5tin_pastscCsL|djo
|i}n|o|ii|Sn|ii|SdS(N(tfmtR(Rt
locale_fmtR-tstrftimeR0(RRFR-((R5Rs


(RR*R+R4RR=R?RGR(RR8R9R:R;R<R2R/R-R@R1RCRDRER4R(((R5R$fs$												cBstZdZhdeieieieiff<Ze	e	dZ
dZe	e	e	dZe
dZdZdZdZRS(	sl
    A class which schedules attempts until one succeeds.

    Intervals are expressed as floating point seconds.

    The retry attempt will be scheduled in the future based on the
    retry_interval which may be either a number of seconds or a
    callable object returning the number of seconds. The callable
    form of the retry_interval is useful when the interval should be
    adjusted based on prior history or other external factors,
    e.g. backing off the frequency of the retry attempts if initial
    attempts fail.

    The retry callback should return False if the attempt fails, in
    which case it will be scheduled again in the future based on the
    current value obtained from the retry_interval. If the retry
    callback returns True it indicates the retry attempt succeeded and
    no more attempts will be made.

    Retry's are started with the start() method and continues until
    the retry callback returns True or the stop() method is called. It
    is always safe to call stop() even if a retry is not pending.

    The retry callback, user_data and notify_interval may be specified
    in either the class init() or in the start() method for convenience.

    If notify_interval is set a 'pending_retry' signal will be emitted
    every time the notification interval elapses, this provides a
    countdown till the next retry attempt.

    The signature of the retry callback is: callback(retry_obj, user_data)

    The signature of the pending_retry signal handler is: callback(retry_obj, seconds_pending, user_data)

    The signature of the retry interval function is: interval(retry_obj, user_data)
    t
pending_retrycCsStii|||_||_||_d|_||_d|_
d|_dS(Ni(tgobjecttGObjectRRtcallbacktretry_intervalt	user_datatfailed_attemptstnotify_intervalR(ttrigger_timet
timeout_id(RRLRMRNRP((R5Rs						cCs1|idj	oti|id|_ndS(N(RRRR(RJt
source_remove(R((R5tstopscCsr|dj	o
||_n|dj	o
||_n|dj	o
||_n|id|_|itdS(Ni(	RMR(RRNRPRTROt_schedule_alarmR4(RRMRNRP((R5tstarts






	cCsti}|o||i|_n|i|}|io,|id||i	t
|i|}n|}ti
t|d|i|_dS(NRIi(R"R/t	new_retryRt_get_retry_intervalRQtseconds_pendingRPtemitRNtmint
alarm_timeRJttimeout_addR/t_alarm_callbackRR(RRWR\R/RY((R5RUs

cCsKd|_ti}|i|}|djo|in|it	S(Nf0.0050000000000000001(
R(RRRR"R/RQRYt_attempt_retryRUR2(RR/RY((R5R^s	


cCsD|i||io|in|id7_|itdS(Ni(RRLRNRTRORUR4(R((R5R_.scCsGt|i}|tjp
|tjo|i||iSn|iS(N(RSRRMt
interval_typet
MethodTypetFunctionTypeRN(RR`((R5RX5s(RR*R,RJtSIGNAL_RUN_LASTt	TYPE_NONEt
TYPE_FLOATt
TYPE_PYOBJECTt__gsignals__R(RRTRVR2RUR^R_RX(((R5R%s$*
			(Ut__all__RRRJRRR7RRRRRtsocketRRttextwrapR"ttypestsetroubleshoot.configRtsetroubleshoot.errcodetsetroubleshoot.logR!R"RtTextWrapperRlRRxR?thref_reRRDR#RRRRR(RRRRRRR	R
RRRRR
RRRRRRRRRRRRRRRRR RttimezoneRtdaylighttaltzoneRRR tHOURttzinfoRR+R$RKR%t
type_register(FRRRRR
RR	RRR+R%RpRRRlRxRRRRhRRRRR!R?RRRRRRRRRRR7RRR R$RRRRjRR
R"RRRRR RR#RRRRRRRRRDRR"RRJRtR((R5t?sx*															
				
	
	
					
										
&			/					)

cr

Anon7 - 2021