https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/sos/policies/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/sos/policies/redhat.pyc
�
p�ebc
@s�ddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddlm
ZddlmZyddlZeZWnek
r�eZnXdZy
eZWnek
r�nXde	fd	��YZd
ZdZede�Zed
e�Zed
ede�ZdddgZdddgZ dZ!dZ"dZ#dZ$e!Z%dZ&dZ'dZ(dZ)eddddg�Z*d Z+d!Z,d"Z-d#Z.ededd$g�Z/d%Z0d&Z1eded
ed'ede �Z2d(Z3d)Z4d*Z5d+Z6ied,e"d-e#d.e5d/e�e"6ed,e$d-e%�e$6ed,e&d-e'd/e*�e&6ed,e(d-e)d.e6d/e�e(6ed,e+d-e,d.e5d/e�e+6ed,e-d-e.d.e5d/e/�e-6ed,e0d-e1d.e3d/e2�e06Z7d0Z8d1Z9d2Z:d3efd4��YZ;d5e;fd6��YZ<d7Z=d8Z>d9Z?ied,e=d-e?d.e5d/e�e=6Z@d:e;fd;��YZAd<e;fd=��YZBd>eAfd?��YZCd@efdA��YZDdS(Bi����(tprint_functionN(tRedHatPlugin(tLinuxPolicytPackageManagertPresetDefaults(t_sos(t
SoSOptionss/etc/os-releasetRedHatPolicycBs�eZdZdZdZdZdZdZdZdZ	ddgZ
eZd	Z
d
ZdZdZdZdd�Zed
��Zd�Zd�Zd�Zd�Zd�ZRS(t
CloudLinuxshttp://www.cloudlinux.com/s/etc/redhat-releases/var/tmps7rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\n"srpm -qalsrpm -Vt	debuginfos-develt/s/opt/rhtfriendlycCsJtt|�jd|�d|_t|_|rG|j�||_n|j�}td|j	d|j
d|jd|jd|�|_
tg|_|j
j�|_|js�tdd	tj�tjd
�n|j|j�|_|jr�d|_n	d|_|jtjd
7_|jtjd7_|j�|j�dS(Ntsysroottt
query_commandtverify_commandt
verify_filtert
files_commandtchroots'Could not obtain installed package listtfileis/usr/sbin:/usr/bin:/root/bins'/sbin:/bin:/usr/sbin:/usr/bin:/root/bins/usr/local/bins/usr/local/sbin(tsuperRt__init__t
ticket_numbertFalsetusrmovet_container_initt
_host_sysrootRt	_rpmq_cmdt	_rpmv_cmdt_rpmv_filtert
_rpmql_cmdtpackage_managerRtvalid_subclassestall_pkgstpkgstprinttsyststderrtexitt
check_usrmovetPATHtostpathsept
set_exec_pathtload_presets(tselfR((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR9s2		
						
cCstS(s�This method checks to see if we are running on Red Hat. It must be
        overriden by concrete subclasses to return True when running on a
        Fedora, RHEL or other Red Hat distribution or False otherwise.(R(tcls((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytcheck^scCsXd|kr.tjjd�o-tjjd�S|dd}|ddkrPtStSdS(sqTest whether the running system implements UsrMove.

            If the 'filesystem' package is present, it will check that the
            version is greater than 3. If the package is not present the
            '/bin' and '/sbin' paths are checked and UsrMove is assumed
            if both are symbolic links.

            :param pkgs: a packages dictionary
        t
filesystems/bins/sbintversionit3N(R)tpathtislinktTrueR(R-R"tfilesys_version((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR'es
"cCsHg}d�}|jr@x!|D]}|j||��qW|S|SdS(s2Mangle paths for post-UsrMove systems.

            If the system implements UsrMove, all files will be in
            '/usr/[s]bin'. This method substitutes all the /[s]bin
            references in the 'files' list with '/usr/[s]bin'.

            :param files: the list of package managed files
        cSsKddg}||kr5|tjjd|d�fStjdd|�fS(Ns/bin/rpms
/bin/mailxs/usris(^)(/s?bin)s\1/usr\2(R)R3tjointretsub(R3t
skip_paths((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyttransform_path�sN(Rtextend(R-tfilestpathsR;tf((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytmangle_package_pathus			
cCs�ttjkr1tjtdkr1t|_q1nttjkrStjt|_n|joh|jdk}|r�tjj|j|j	�}||_	n|r�|jSdS(s�Check if sos is running in a container and perform container
        specific initialisation based on ENV_HOST_SYSROOT.
        tdockertociR
(RARBN(t
ENV_CONTAINERR)tenvironR5t
_in_containertENV_HOST_SYSROOTRR3tabspatht_tmp_dirtNone(R-tuse_sysrootthost_tmp_dir((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�scCs�ddlm}m}g}|d|dtd|d|dddt�}|j�\}}|rf|Sxj|j�d	D]X}y|jd
d	�\}	}
Wntk
r�qwX|
dkrw|jt|	��qwqwW|S(Ni����(tPopentPIPEs"LC_ALL=C /sbin/chkconfig --list %stshelltstdoutR%tbufsizet	close_fdsit:ton(	t
subprocessRLRMR5tcommunicatetsplitt
IndexErrortappendtint(R-tnameRLRMtrettptoutterrttabstrunleveltonoff((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytrunlevel_by_service�s&
	
cCs|s
|jS|S(N(RH(R-topt_tmp_dir((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytget_tmp_dir�sN(t__name__t
__module__tdistrotvendort
vendor_urlt_redhat_releaseRHRRRRRRERtdefault_scl_prefixtname_patternRIt
upload_urltupload_userRtclassmethodR/R'R@RRbRd(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR(s,%				t	containertHOSTtverifytall_logstboottstoragetsystemsboot.all-images=onsrpm.rpmva=onsrpm.rpmdb=onsRed Hat Enterprise LinuxtrhvsRed Hat VirtualizationtrheltrhospsRed Hat OpenStack Platformtocps'OpenShift Container Platform by Red Hattplugoptssprocess.lsof=offs#networking.ethtool_namespaces=Falsesnetworking.namespaces=200tcfmesRed Hat CloudFormst	satellitesRed Hat Satellites
apache.log=ontcantboots(For use when normal system startup failstprofiless9Data collection will be limited to a boot-affecting scopes$This preset may increase report sizes(This preset may increase report run times1This preset may increase report size and run timeRZtdesctnotetoptssZ
Any information provided to %(vendor)s will be treated in accordance with the published support policies at:

  %(vendor_url)s

The generated archive may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party.

No changes will be made to system configuration.
shttps://api.access.redhat.comssftp://sftp.access.redhat.comt
RHELPolicycBs�eZdZdZdZeded�ZeZ	dd�Zed��Z
d�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�ZRS(Rshttp://www.cloudlinux.com/sThis command will collect diagnostic and configuration information from this %(distro)s system and installed applications.

An archive containing the collected information will be generated in %(tmpdir)s and may be provided to a %(vendor)s support representative.
s%(vendor_text)s
cCs*tt|�jd|�|jt�dS(NR(RR�Rtregister_presetstrhel_presets(R-R((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyRscCs�tjjt�stSttd��d}xZ|D]R}|jd�r/|jd�\}}|jd�}|j|j	�r�t
Sq/q/WWdQXtS(s�Test to see if the running host is a RHEL installation.

            Checks for the presence of the "Red Hat Enterprise Linux"
            release string at the beginning of the NAME field in the
            `/etc/os-release` file and returns ``True`` if it is
            found, and ``False`` otherwise.

            :returns: ``True`` if the host is running RHEL or ``False``
                      otherwise.
        trtNAMEt=s"'N(R)R3texistst
OS_RELEASERtopent
startswithRVtstripRgR5(R.R?tlineRZtvalue((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR/s
cCs`|jdjrdS|jdjr;tt|�j�dS|jr\ttd��|_ndS(NtcmdlineoptssVEnter your Red Hat Customer Portal username for uploading [empty for anonymous SFTP]: (	tcommonsRnRmRR�tprompt_for_upload_usertcase_idtinputt_(R-((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�3s	cCsa|jr|jS|jdjr.|jdjS|jdjdkrHtSd}t||jSdS(NR�tsftps /support/v1/cases/%s/attachments(RmR�tupload_protocoltRH_SFTP_HOSTtRH_API_HOSTR�(R-trh_case_api((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytget_upload_url@s	cCs+|j�jt�r'idd6dd6SiS(Ntfalset	isPrivatesno-caches
cache-control(R�R�R�(R-((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyt_get_upload_headersKscCs9|j�jt�rdS|j�jt�r2dS|jS(NsRed Hat Customer PortalsRed Hat Secure FTP(R�R�R�R�Rm(R-((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytget_upload_url_stringPs
cCs4|jjd�d}|jr0d|j|fS|S(s�The RH SFTP server will only automatically connect file uploads to
        cases if the filename _starts_ with the case number
        R
i����s%s_%s(tupload_archive_nameRVR�(R-tfname((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyt_get_sftp_upload_nameWs	c	Cs�tjd�d|j�kr2tt|�j�StsGtd��nd}d}t	d}|j
�r�|j�r�|j�}t
j|d|dd�}|jdkr�|j
�}tj|j�d	}q�td
�n|s]itd6}t
j|dtj|�dd�}|jdkr]tj|j�}|d
}|d	}td|�q]n|r�|r�tt|�jd|d|�Std��dS(s�Override the base upload_sftp to allow for setting an on-demand
        generated anonymous login for the RH SFTP server if a username and
        password are not given
        s//isOpython-requests is not installed and is required for obtaining SFTP auth token.s/support/v2/sftp/tokentauthttimeouti
i�ttokensUUnable to retrieve Red Hat auth token using provided credentials. Will try anonymous.tisAnonymoustdatatusernamesHUsing anonymous user %s for upload. Please inform your support engineer.tusertpasswords1Could not retrieve valid or anonymous credentialsN(R�RVR�RR�tupload_sftptREQUESTS_LOADEDt	ExceptionRIR�tget_upload_usertget_upload_passwordtget_upload_https_authtrequeststposttstatus_codetjsontloadsttextR#R5tdumps(	R-t_tokent_userturlR�R[tadatatanontresp((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�`s6


$

cCs�yB|j�s|j�r)t|_ntt|�j|�}Wn^tk
r�t}|jj	t
�sp�q�tdt�t|_tt|�j|�}nX|S(sOverride the base upload_archive to provide for automatic failover
        from RHCP failures to the public RH dropbox
        s3Upload to Red Hat Customer Portal failed. Trying %s(R�R�R�RmRR�tupload_archiveR�RR�R�R#(R-tarchivetuploaded((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR��s
	cCs�y�|jjd�}|j|dd}|ddkr>dS|ddkrRdS|dd	krfd
S|ddkrzdS|dd
kr�dSWntk
r�nXtS(Nsredhat-release*iR1t4it5Servert5Clientit6it7it8i(R�R�(Rtall_pkgs_by_name_regexR"R�R(R-trrtpkgname((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytdist_version�s 
cCs�x7ddgD])}|jjd|�r
|jt�Sq
W|jd�dk	r\|jt�S|jd�dk	r~|jt�S|jd�dk	r�|jt�S|jd�dk	s�|jd�dk	r�|jt	�S|jt
�S(	Ntrescuet	emergencys	%s.targetssatellite-commons
rhosp-releaseR|sovirt-enginetvdsm(tinit_systemt
is_runningtfind_presettCBtpkg_by_nameRItRH_SATELLITEtRHOSPtRH_CFMEtRHVtRHEL(R-ttarget((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytprobe_preset�s



N(ReRfRgRhRiR�tdisclaimer_texttmsgR�t_upload_urlRIRRoR/R�R�R�R�R�R�R�R�R�(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�s"	
						)		tCentOsPolicycBseZdZdZdZRS(tCentOSshttps://www.centos.org/(ReRfRgRhRi(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR��statomictAtomics$Red Hat Enterprise Linux Atomic HosttRedHatAtomicPolicycBsFeZdZeded�Zdd�Zed��Z	d�Z
RS(sRed Hat Atomic Hosts�This command will collect diagnostic and configuration information from this %(distro)s system.

An archive containing the collected information will be generated in %(tmpdir)s and may be provided to a %(vendor)s support representative.
s%(vendor_text)s
cCs*tt|�jd|�|jt�dS(NR(RR�RR�tatomic_presets(R-R((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�scCs�t}ttjkr|Stjt|j}tjj|�sCtSy:x3t|d�j�j	�D]}|t
|kO}qbWWntk
r�nX|S(NR�(RRFR)RDRjR3R�R�treadt
splitlinestATOMIC_RELEASE_STRtIOError(R.R�thost_releaseR�((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR/�s"
cCs)|jd�r|jt�S|jt�S(Nsatomic-openshift(R�R�tRHOCPtATOMIC(R-((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR��s
N(ReRfRgR�R�R�RIRRoR/R�(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR��stRedHatCoreOSPolicycBsFeZdZeded�Zdd�Zed��Z	d�Z
RS(sRed Hat CoreOSs�This command will collect diagnostic and configuration information from this %(distro)s system.

An archive containing the collected information will be generated in %(tmpdir)s and may be provided to a %(vendor)s support representative.
s%(vendor_text)s
cCstt|�jd|�dS(NR(RR�R(R-R((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyRscCst}ttjkr|Stjt|j}y:x3t|d�j�j�D]}|d|kO}qLWWntk
rznX|S(NR�sRed Hat CoreOS(	RRFR)RDRjR�R�R�R�(R.tcoreosR�R�((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR/s"
cCs
|jt�S(N(R�R�(R-((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�sN(ReRfRgR�R�R�RIRRoR/R�(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR��s
tCentOsAtomicPolicycBseZdZdZdZRS(sCentOS Atomic HostR�shttps://www.centos.org/(ReRfRgRhRi(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�stFedoraPolicycBs>eZdZdZdZdd�Zed��Zd�Z	RS(tFedorasthe Fedora Projectshttps://fedoraproject.org/cCstt|�jd|�dS(NR(RR�R(R-R((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR$scCstjjd�S(sXThis method checks to see if we are running on Fedora. It returns
        True or False.s/etc/fedora-release(R)R3tisfile(R.((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR/'scCs0|jd�p|jd�d}t|d�S(Nsfedora-releasesfedora-release-.*i����R1(R�R�RY(R-tpkg((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pytfedora_version-sN(
ReRfRgRhRiRIRRoR/R�(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyR�s(Et
__future__RR�R)R$R8tsos.pluginsRtsos.policiesRRRtsosRR�RR�R5R�tImportErrorRR�t	raw_inputR�t	NameErrorRRCRFt_opts_verifyt_opts_all_logst_opts_all_logs_verifyt_cb_profilest_cb_plugoptstRHEL_RELEASE_STRR�tRHV_DESCR�t	RHEL_DESCR�t
RHOSP_DESCR�t
RHOCP_DESCt
RHOSP_OPTSR�tRH_CFME_DESCR�tRH_SATELLITE_DESCtSAT_OPTSR�tCB_DESCtCB_OPTStCB_NOTEt	NOTE_SIZEt	NOTE_TIMEtNOTE_SIZE_TIMER�R�R�R�R�R�R�R�tATOMIC_DESCR�R�R�R�R�(((s7/usr/lib/python2.7/site-packages/sos/policies/redhat.pyt<module>s�




�	


%�
%!

https://t.me/AnonymousX5 - 2025