HEX
Server: LiteSpeed
System: Linux oxygen.shetabanhost.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: rasapedi (1695)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/leapp/reporting/__init__.pyo
�
�S4bc@seddlZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZde
fd��YZed�Zd	efd
��YZdefd��YZd
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!efd"��YZ d#efd$��YZ!d%efd&��YZ"d'efd(��YZ#d)�Z$ed*�Z%d+�Z&d,�Z'ej(d-d.�Z)d/�Z*d0�Z+dS(1i����N(tstring_types(tfieldstModelt
ErrorModel(tReportTopic(tproducetReportcBs&eZdZeZeZej�Z	RS(s,
    Framework model used for reporting
    (
t__name__t
__module__t__doc__tTruet__non_inheritable__RttopicRtJSONtreport(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyRscCs�x5|d D])}||kr*i||<n||}qW|rf|j|dg�|g||d<n?|d|kr�tdjdj|����n|||d<dS(Ni����sPath {} is already takent.(tgett
ValueErrortformattjoin(tdatatpathtvaluet	leaf_listtp((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt_add_to_dicts
(!t
BasePrimitivecBsPeZdZdZdd�Zed��Zed��Zd�Z	d�Z
RS(sT
    Report primitive (field) base class for dict targets (implies unique path)
    tcCs:t|t�s-tdj|jj���n||_dS(NsValue of "{}" must be a string(t
isinstanceRt	TypeErrorRt	__class__Rt_value(tselfR((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt__init__/scCs|jS(sReturn report field value(R(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR4scCs
|jfS(s>Return report field destination path (nested dict description)(tname(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR9scCsi|j|j6S(N(RR"(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pytto_dict>scCs t||j|jdt�dS(s:Add report entry to the report dict based on provided pathRN(RRRtFalse(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pytapplyAsN(RRR	R"tNoneR!tpropertyRRR#R%(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR(s	tBaseListPrimitivecBseZdZd�ZRS(sZ
    Report primitive (field) base class for list targets (we append value to a list)
    cCs t||j|jdt�dS(s:Add report entry to the report dict based on provided pathRN(RRRR
(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR%Ks(RRR	R%(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR(FstTitlecBseZdZdZRS(sReport titlettitle(RRR	R"(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR)PstSummarycBseZdZdZRS(sReport summarytsummary(RRR	R"(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR+UstSeveritycBs8eZdZdZdZdZdZdZdd�Z	RS(sReport severitytseveritytinfotlowtmediumthighcCsX|j|j|j|jf}||krKtdjdj|����n||_dS(NsSeverity should be one of: "{}"t (tINFOtLOWtMEDIUMtHIGHRRRR(R Rt
severities((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!cs!N(
RRR	R"R4R5R6R7R&R!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR-ZstAudiencecBs eZdZdZdd�ZRS(sTarget audience of the reporttaudiencecCs^t|t�std��nd}||krQtdjdj|����n||_dS(Ns$Value of "Audience" must be a stringtsysadmint	developersAudience should be one of: "{}"R3(R;R<(RRRRRRR(R Rt	audiences((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!ns!N(RRR	R"R&R!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR9jstFlagscBs,eZdZdZdZdZdd�ZRS(sReport flagstflagst	inhibitortfailurecCs+t|t�std��n||_dS(NsValue of "Flags" must be a list(RtlistRR(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!~sN(RRR	R"t	INHIBITORtFAILURER&R!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR>ws
tKeycBseZdZdZd�ZRS(s%Stable identifier for report entries.tkeycCs.t|tj�s!td��n||_dS(NsKey value should be a string.(RtsixRRR(R tuuid((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�s(RRR	R"R!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyRE�stTagscBsneZdZdZdefd��YZed�Zed�Zed�Zed�Z	ed�Z
ed	�Zed
�Zed�Z
ed�Zed
�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zed�Zdd�Z!RS( sReport tagsttagst_ValuecBseZd�ZRS(cCs
||_dS(N(R(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�s(RRR!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyRK�st
accessibilitytauthenticationtboott
communicationsdesktop environmenttdriverstemailt
encryptiont
filesystemtfirewallshigh availabilitytkernelt
monitoringtnetworksOS factsspublic cloudtpythont
repositorytrhuitsanitytsecuritytselinuxtservicesstime managementttoolssupgrade processcCs{t|t�std��ntg|D]}t|tj�^q(�sXtd��ng|D]}|j^q_|_dS(NsValue of "Tags" must be a lists-Unsupported tag value passed for Report Tags.(RRBRtallRIRKRR(R Rtv((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�s
+N("RRR	R"tobjectRKt
ACCESSIBILITYtAUTHENTICATIONtBOOTt
COMMUNICATIONtDESKTOPtDRIVERStEMAILt
ENCRYPTIONt
FILESYSTEMtFIREWALLtHIGH_AVAILABILITYtKERNELt
MONITORINGtNETWORKtOS_FACTStPUBLIC_CLOUDtPYTHONt
REPOSITORYtRHUItSANITYtSECURITYtSELINUXtSERVICEStTIME_MANAGEMENTtTOOLStUPGRADE_PROCESSR&R!(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyRI�s<tExternalLinkcBs2eZdZdZddd�Zed��ZRS(s!External link report detail fieldtexternalcCsFtd�||fD��s+td��ni|d6|d6|_dS(Ncss|]}t|t�VqdS(N(RR(t.0Ra((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>�ss;Values "url" and "title" of "ExternalLink" must be a stringturlR*(R`RR(R R�R*((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�scCsdS(NtdetailR~(R�R~((R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR�sN(RRR	R"R&R!R'R(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR}�stRelatedResourcecBs2eZdZdZddd�Zed��ZRS(sHReport detail field for related resources (e.g. affected packages/files)trelated_resourcescCsFtd�||fD��s+td��ni|d6|d6|_dS(Ncss|]}t|t�VqdS(N(RR(RRa((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>�ssFValues "scheme" and "identifier" of "RelatedResource" must be a stringtschemeR*(R`RR(R R�t
identifier((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�scCsdS(NR�R�(sdetailR�((R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR�sN(RRR	R"R&R!R'R(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��stBaseRemediationcBs#eZdZdZed��ZRS(sRemediation base classtremediationscCsdS(NR�R�(sdetailR�((R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR�s(RRR	R"R'R(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��stRemediationCommandcBseZdd�Zd�ZRS(cCs9t|t�std��nidd6|d6|_dS(Ns,Value of "RemediationCommand" must be a listtcommandttypetcontext(RRBRR(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�scCs'dj|jddj|jd��S(Ns[{}] {}R�R3R�(RRR(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt__repr__�sN(RRR&R!R�(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��stRemediationHintcBseZdd�Zd�ZRS(cCsidd6|d6|_dS(NthintR�R�(R(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�scCsdj|jd|jd�S(Ns[{}] {}R�R�(RR(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��sN(RRR&R!R�(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��stRemediationPlaybookcBseZdd�Zd�ZRS(cCsidd6|d6|_dS(NtplaybookR�R�(R(R R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�scCsdj|jd|jd�S(Ns[{}] {}R�R�(RR(R ((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��sN(RRR&R!R�(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��stRemediationcBsDeZdddd�Zd�Zd�Zd�Zed��ZRS(cCs�g|_|r+|jjtd|��n|r^x*|D]}|jjtd|��q8Wn|r�|jjtd|��ndS(NR(t
_remediationstappendR�R�R�(R R�tcommandsR�R�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR!�s	
 cCs%x|jD]}|j|�q
WdS(N(R�R%(R Rtremediation((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR%scCs)djg|jD]}t|�^q�S(Ns
(RR�trepr(R tr((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR�
scCs'ig|jD]}|j�^q
d6S(NR�(R�R#(R R�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR#
scCs�|jdg�}td�|D�d�}td�|D�d�}g|D] }|ddkrK|d^qK}|r�t|||�SdS(NR�css)|]}|ddkr|dVqdS(R�R�R�N((RRa((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>scss)|]}|ddkr|dVqdS(R�R�R�N((RRa((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>sR�R�R�(RtnextR&R�(tclsRtvaluesR�R�RaR�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt	from_dicts-N(	RRR&R!R%R�R#tclassmethodR�(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR��s

			cCs�td�|D��s%td��ntd�|D��sJtd��ntd�|D��sv|jtd��ntd�|D��s�|jtd��nt|d	tjd
d�dk�dS(Ncss|]}t|t�VqdS(N(RR)(Rte((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>ss!Title not provided in the report.css|]}t|t�VqdS(N(RR+(RR�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>ss#Summary not provided in the report.css|]}t|t�VqdS(N(RR-(RR�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>sR/css|]}t|t�VqdS(N(RR9(RR�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>!sR;traise_if_undefinedtLEAPP_DEVEL_FIXED_REPORT_KEYt0(tanyRR�R-R9t_check_stable_keytostgetenv(tentries((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt_sanitize_entriesscs��fd�}tjd�}|t�}|dk	rb|j�s^|jd�td��ndS|rwtd��ndjd|t�d	|t	�d
|t
��}tj|j
d��j�}�jt|��|jdj|��dS(
s�
    Inserts a Key into the entries of the report if it doesn't exist.

    The resulting id is calculated from the mandatory report
    entries (severity, audience, title).
    Please note that the original entries list is modified.
    cs0t�fd��D�d�}|r,|jSdS(Nc3s$|]}t|��r|VqdS(N(R(RR�(R�(s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pys	<genexpr>/s(R�R&R(R�tentry(R�(R�s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt_find_entry.ssleapp.reportings#An empty string is specified as KeysKey can not be an empty string.Ns@Stable Key report entry with specified unique value not providedu{severity}:{audience}:{title}R.R:R*sutf-8sEStable Key report entry not provided, dynamically generating one - {}(tloggingt	getLoggerRER&tstripterrorRRR-R9R)thashlibtsha1tencodet	hexdigestR�twarning(R�R�R�tloggerRFtkey_strt	key_value((R�s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyR�&s 
cCs;i}t|�x|D]}|j|�qWtd|�S(NR(R�R%R(R�RR�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt_create_report_objectHs


cCstt|��dS(s&
    Produce final report message
    N(RR�(R�((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt
create_reportRstdaysi�cCs�tjj|dd�j�}tj}|tjj�tkrMtj}ntt	dj
d|djd�dd|dd|d��t|�td	�t
d
j
d|dd|dd|dd|dd|d��g�}tj|j�d
�S(s1
    Convert deprecation json to report json
    tsinces%Y-%m-%ds {message} at {filename}:{lineno}tmessages
itfilenametlinenoR<sB{reason}
Since: {since}
Location: {filename}:{lineno}
Near: {line}treasontlineR(tdatetimetstrptimetdateR-R6ttodayt_DEPRECATION_SEVERITY_THRESHOLDR7R�R)RtsplitR9R+tjsontloadstdump(tdeprecationR�R.R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pytcreate_report_from_deprecation\s$	

		



cCshtj|�}t|j�t|jp*d�td�td�g}t|�}t	j
|j�d�S(s+
    Convert error json to report json
    RR2R;R(RtcreateR)R�R+tdetailsR-R9R�R�R�R�(t
error_dictR�R�R((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pytcreate_report_from_errorxs6(,R�R�R�R�R�RGtleapp.compatRtleapp.modelsRRRtleapp.topicsRtleapp.libraries.stdlib.apiRRR$RRbRR(R)R+R-R9R>RERIR}R�R�R�R�R�R�R�R�R�R�t	timedeltaR�R�R�(((s</usr/lib/python2.7/site-packages/leapp/reporting/__init__.pyt<module>sD


,	
	"