MOON
Server: Apache
System: Linux server2.shieldcogroup.com 3.10.0-1160.119.1.el7.tuxcare.els12.x86_64 #1 SMP Fri Nov 8 05:49:38 UTC 2024 x86_64
User: jacom (1029)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python2.7/site-packages/leapp/utils/report.pyo
�
g��fc@s	ddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZmZd�Zd�Zidej6dej6dej6d	ej6Zd
�Zd�Zd�Zd
�Zd�Zdd�ZdS(i����N(t_DEPRECATION_FLAGSt_UPCOMING_DEPRECATION_FLAGStExternalLinktGroupstRemediationtSeveritytcreate_report_from_errortcreate_report_from_deprecation(tget_messagestget_audit_entryc
Cs1g}t�}xtddd|�D]}tj|d�}tj|dt�jd�}tj|�j	�}||kr�q%n|j
|�t|�}tj�}|j|jd��|j|djd��i|dd6t
jd	d
6|dd6|j	�d6}	|j|	�|j|�q%W|S(
Nteventtdeprecationtcontexttdatat	sort_keyssutf-8tstampt	timeStamptLEAPP_HOSTNAMEthostnametactortid(tsetR	tjsontloadstdumpstTruetencodethashlibtsha256t	hexdigesttaddRtupdatetostenvirontappend(
t
context_idtreportstcachetentryR
t
_data_dumpt	data_hashtreportRtenvelope((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyt!_create_reports_from_deprecationss*	

c	CsNtdddgd|�pg}g}x
|D]}|dd}tj�}|j|ddjd��|j|djd��|jt|d	�jd��i|d
d6|dd6|d
d
6|j�d	6}tj|�}tj|j	dd��}|st
|�}n|j|�|j|�q.W|jt
|��|S(s�
    :param context_id: ID to identify the needed messages
    :type context_id: str
    :return: All upgrade messages of type "Report" within the given context
    tnamestReportt
ErrorModelRtmessageR
thashsutf-8RRRRRR)s{}(RRRRRtstrRRRtgetRR"textendR+(	R#treport_msgstmessagesR/R
RR*t	data_jsonR)((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pytfetch_upgrade_report_messages4s*!
 
iiiicCst|tj�S(N(thas_flag_groupRt	INHIBITOR(R/((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pytis_inhibitorbscCs"||jd|jdg��kS(st
    A helper to check if a message has Group which would have been a Flag before the Tags/Flags merge in 1.2.0
    tgroupstflags(R2(R/tgroup((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyR8fscCs@t|tj�rdSt|tj�r,dStj|dd�S(Ni����itseverityic(R8Rt_ERRORR9tSEVERITY_LEVELSR2(R/((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyt
importanceos
cCs#t|tj�r|jd�S|S(su
    Ensure the given text is decoded.

    This is problem in case of Py2 when non-asci characters are present.
    sutf-8(t
isinstancetsixtbinary_typetdecode(ttext((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyt
_treat_strwscCs�d}tj|j�kr(|tjnd}tj|�}|r�d}x8|D]0}|djt|d�t|d��7}qPW||7}n|r�dj|�}|t|�7}n|S(NuuRelated links:
u
    - {}: {}
ttitleturlsRemediation: {}
(RtnametkeystNoneRt	from_dicttformatRG(t
report_detailtdetailtexternal_linkstremediationtexternal_links_texttlinktremediation_text((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyt_report_detail_to_string�s(
	

s1.1.0c
Cstd�|jd�D��}|jd�r_tj|ddd��}x
t|dt�D]�}d}t|tj	�r�d	}nt|tj
�r�d
}n|jdj|d|��|jd
j|d��|jdj|d��t
|jdi��}|j|�|d"kr=|jdj|d��n|jddd�q\WWdQXn�|jd�r
tj|ddd��}|d#kr�t|�}x|D]}	|	jd�q�Wn|d$kr^t|�}x�|D]v}
|
jdg�}g|D]}|tkr|^q|
d<g|D]$}|tkr)|tkr)|^q)|
d<q�Wn|d%kr�t|�}x!|D]}
|
jdd�q}Wntji|d6|d6ddd t�}
t|
tj�r�|
jd�}
n|j|
�|jd!�WdQXndS(&Ncss|]}t|�VqdS(N(tint(t.0tx((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pys	<genexpr>�st.s.txttwtencodingsutf-8tkeyts(error)s(inhibitor)uRisk Factor: {} {}
R>u
Title: {}
RHuSummary: {}
tsummaryRPiiuKey: {}
u-i(s
s.jsoniR;R<ttagstentriestleapp_run_idtindenttensure_asciiu
(iii(iii(iii(iii(ttupletsplittendswithtiotopentsortedRAR8RR?R9twriteRNRVR2tlisttpopRRRLRRtFalseRBRCRDRE(tmessages_to_reportRtpatht
report_schematreport_schema_tupletfR/tflagRPtmtmsgR;tgR
((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pytgenerate_report_file�sN		
"

)
/
)
(RRhRR RCtleapp.reportingRRRRRRRRtleapp.utils.auditRR	R+R7tHIGHtMEDIUMtLOWtINFOR@R:R8RARGRVRx(((s6/usr/lib/python2.7/site-packages/leapp/utils/report.pyt<module>s&:
		&