/usr/lib/python3/dist-packages/sos/policies/distros/__pycache__
NameSizeModeActions
almalinux.cpython-310.pyc9260644editdlrm
amazon.cpython-310.pyc8040644editdlrm
anolis.cpython-310.pyc8370644editdlrm
azure.cpython-310.pyc11090644editdlrm
circle.cpython-310.pyc8380644editdlrm
cloudlinux.cpython-310.pyc8670644editdlrm
cos.cpython-310.pyc15550644editdlrm
debian.cpython-310.pyc22850644editdlrm
opencloudos.cpython-310.pyc8360644editdlrm
openeuler.cpython-310.pyc9240644editdlrm
redhat.cpython-310.pyc136290644editdlrm
rocky.cpython-310.pyc8900644editdlrm
suse.cpython-310.pyc28680644editdlrm
ubuntu.cpython-310.pyc21970644editdlrm
uniontechserver.cpython-310.pyc8440644editdlrm
__init__.cpython-310.pyc135470644editdlrm
Edit: /usr/lib/python3/dist-packages/sos/policies/distros/__pycache__/redhat.cpython-310.pyc (13629B)
o G%@iz;@sddlZddlZddlZddlmZddlmZmZmZm Z m Z m Z m Z m Z mZmZddlmZmZmZddlmZddlmZddlmZddlmZdd lmZd ZGd d d eZ d Z!dZ"dZ#Gddde Z$Gddde$Z%Gddde$Z&Gddde Z'dS)N) RedHatPlugin) RHEL_PRESETSRHVRHELCBRHOSPRHOCPRH_CFME RH_SATELLITEAAPEDA AAPCONTROLLER) LinuxPolicyENV_HOST_SYSROOT OS_RELEASE)RpmPackageManager)FlatpakPackageManager)MultiPackageManager)bold)_soszRed Hat Enterprise Linuxcs~eZdZdZddgZdZdZdZdZdZ dZ d Z d Z d Z d Z dfdd ZefddZddZddZddZZS) RedHatPolicyRed Hat)zDistribution Websitezhttps://www.redhat.com/)zCommercial Supportzhttps://access.redhat.com/z/var/tmpFfriendlyNpodmansosz /usr/sbinzVhttps://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/auth/devicezPhttps://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/tokenTcstj||||dd|_tttg|j|d|_|jt g7_|jj |_ |j s3t j dt d||j |_|jrAd|_nd|_|jtjd7_|jtjd 7_|js_||dS) Nsysrootinit probe_runtime remote_execF)primary fallbackschrootrz'Could not obtain installed package listz/usr/sbin:/usr/bin:/root/binz'/sbin:/bin:/usr/sbin:/usr/bin:/root/binz/usr/local/binz/usr/local/sbin)super__init__usrmoverrrrpackage_managervalid_subclassesrpackagespkgssysstderrwriteexit check_usrmovePATHospathsepr set_exec_path load_presetsselfrrrr __class__=/usr/lib/python3/dist-packages/sos/policies/distros/redhat.pyr$1s2     zRedHatPolicy.__init__csz|turtt||dS|dttttd}|D]\}}t d|}|jdd|d|j ddd qdS) NzThis policy is a building block for all other Red Hat family distributions. You are likely looking for one of the distributions listed below. )centosrhel redhatcoreosfedoraz policies. z>8z<35z<30F)newline) rr#display_distro_helpadd_text CentOsPolicy RHELPolicyRedHatCoreOSPolicy FedoraPolicyitemsros_release_name)clssectionsubssubcvaluesublnr6r8r9r@Ss$z RedHatPolicy.display_distro_helpcCs8d|vrtjdotjdS|dd}|ddkS)aqTest 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 filesystemz/binz/sbinversionr3)r0pathislink)r5r)filesys_versionr8r8r9r.ls   zRedHatPolicy.check_usrmovecCs2g}dd}|jr|D] }|||q |S|S)a2Mangle 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 cSs:ddg}||vr|tjd|ddfStdd|fS)Nz/bin/rpmz /bin/mailxz/usrr"z (^)(/s?bin)z\1/usr\2)r0rQjoinresub)rQ skip_pathsr8r8r9transform_pathsz8RedHatPolicy.mangle_package_path..transform_path)r%extend)r5filespathsrXfr8r8r9mangle_package_path{s z RedHatPolicy.mangle_package_pathcCs|s|jS|SN)_tmp_dir)r5 opt_tmp_dirr8r8r9 get_tmp_dirszRedHatPolicy.get_tmp_dirNNTN)__name__ __module__ __qualname__vendor vendor_urlsr_ _in_container name_pattern upload_url upload_userdefault_container_runtime sos_pkg_name sos_bin_pathclient_identifier_urltoken_endpointr$ classmethodr@r.r]ra __classcell__r8r8r6r9rs."ra[ Any information provided to %(vendor)s will be treated in accordance with the published support policies at: %(vendor_urls)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. zhttps://api.access.redhat.comzsftp://sftp.access.redhat.comcsfeZdZdZdZdZeZdZe de dZ e Z dZdZd Z dfd d Zd dZddZZS)rCat The RHEL policy is used specifically for Red Hat Enterprise Linux, of any release, and not forks or derivative distributions. For example, this policy will be loaded for any RHEL 8 installation, but will not be loaded for CentOS Stream 8 or Red Hat CoreOS, for which there are separate policies. Plugins activated by installed packages will only be activated if those packages are installed via RPM (dnf/yum inclusive). Packages installed by other means are not considered by this policy. By default, --upload will be directed to using the SFTP location provided by Red Hat for technical support cases. Users who provide login credentials for their Red Hat Customer Portal account will have their archives uploaded to a user-specific directory. If users provide those credentials as well as a case number, --upload will instead attempt to directly upload archives to the referenced case, thus streamlining the process of providing data to technical support engineers. If either or both of the credentials or case number are omitted or are incorrect, then a temporary anonymous user will be used for upload to the SFTP server, and users will need to provide that information to their technical support engineer. This information will be printed at the end of the upload process for any sos report execution. rz/etc/redhat-releaser;aThis command will collect diagnostic and configuration information from this %(os_release_name)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. %(vendor_text)s postNi@Tcs"tj||||d|tdSNr)r#r$register_presetsrr4r6r8r9r$s zRHELPolicy.__init__cCsBz|jd}|j|dd}t|dWSty YdSw)Nzredhat-release*rrOF)r&all_pkgs_by_name_regexr)int Exception)r5rrpkgnamer8r8r9 dist_versions  zRHELPolicy.dist_versioncCsdD]}|j|ddr|tSq|ddur"|tS|ddur.|tS|ddur:|tS|ddusH|ddurM|tS|d durY|t Sd D]}||durk|t Sq[|t S) N)rescue emergencyz.targetFzsatellite-commonz rhosp-releasecfmez ovirt-enginevdsmzautomation-controller-server)zautomation-eda-controllerz automation-eda-controller-server) init_system is_running find_presetr pkg_by_namer rr rr r r)r5targetpkgr8r8r9 probe_presets(      zRHELPolicy.probe_presetrb)rcrdre__doc__rfos_release_fileRHEL_RELEASE_STRrG os_release_id_disclaimer_textmsg RH_SFTP_HOST _upload_url_upload_method _device_token_max_size_requestr$r|rrrr8r8r6r9rCs(  rCc@s"eZdZdZdgZdZdZdZdS)rBCentOS)Community Websitezhttps://www.centos.org/z/etc/centos-releasez CentOS Linuxr:N)rcrdrerfrgrrGrr8r8r8r9rBs rBcszeZdZdZdZededZdZdZ dZ dZ d Z d Z  dfd d ZedddZddZdddZddZZS)rDaB Red Hat CoreOS is a containerized host built upon Red Hat Enterprise Linux and as such this policy is built on top of the RHEL policy. For users, this should be entirely transparent as any behavior exhibited or influenced on RHEL systems by that policy will be seen on RHCOS systems as well. The one change is that this policy ensures that sos collect will deploy a container on RHCOS systems in order to facilitate sos report collection, as RHCOS discourages non-default package installation via rpm-ostree which is used to maintain atomicity for RHCOS nodes. The default container image used by this policy is the support-tools image maintained by Red Hat on registry.redhat.io. Note that this policy is only loaded when sos is directly run on an RHCOS node - if sos collect uses the `oc` transport (the default transport that will be attempted by the ocp cluster profile), then the policy loaded inside the launched pod will be RHEL. Again, this is expected and will not impact how sos report collections are performed. zRed Hat Enterprise Linux CoreOSzThis command will collect diagnostic and configuration information from this %(os_release_name)s system. An archive containing the collected information will be generated in %(tmpdir)s and may be provided to a %(vendor)s support representative. rsTrz®istry.redhat.io/rhel8/support-toolsz/hostz rpm -q sosz/var/lib/kubelet/config.jsonNctj||||ddSrur#r$r4r6r8r9r$4  zRedHatCoreOSPolicy.__init__cCs|rd|vSd}ttjvr|Stjtt}z,t|ddd}|D] }||j|vO}q%WdW|S1s;wYW|StyLY|Sw)NCoreOSFrzutf-8)encoding) rr0environropenread splitlinesrGIOError)rHremotecoreos host_releasehfileliner8r8r9check:s&   zRedHatCoreOSPolicy.checkcCs |tSr^)rrr5r8r8r9rMs zRedHatCoreOSPolicy.probe_presetFc CsL|p|j}|r dnd}|jd|jd|jd|d|d|p dd| S)Nz --pull=alwaysrz run -di --name zE --privileged --ipc=host --net=host --pid=host -e HOST=/host -e NAME=z -e IMAGE=r>zr -v /run:/run -v /var/log:/var/log -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -v /:/host )container_imagecontainer_runtimesos_container_name)r5imageauth force_pull_image_pullr8r8r9create_sos_containerRs    z'RedHatCoreOSPolicy.create_sos_containercCs d|jS)Nzpodman rm --force )rrr8r8r9set_cleanup_cmdbs z"RedHatCoreOSPolicy.set_cleanup_cmdrb)r)NNF)rcrdrerrGrrr containerizedrrsos_path_stripcontainer_version_commandcontainer_authfiler$rqrrrrrrr8r8r6r9rDs,   rDcsJeZdZdZdZddgZdZdZdZdZ dfd d Z d dZ Z S)rEaj The policy for Fedora based systems, regardless of spin/edition. This policy is based on the parent Red Hat policy, and thus will only check for RPM packages when considering packaged-based plugin enablement. Packages installed by other sources are not considered. There is no default --upload location for this policy. If users need to upload an sos report archive from a Fedora system, they will need to provide the location via --upload-url, and optionally login credentials for that location via --upload-user and --upload-pass (or the appropriate environment variables). zthe Fedora Project)rzhttps://fedoraproject.org/)zCommunity Forumsz%https://discussion.fedoraproject.org/z/etc/fedora-releasez Fedora Linuxr=z/usr/binNTcrrurr4r6r8r9r$}rzFedoraPolicy.__init__cCs&|dp |jdd}t|dS)Nzfedora-releasezfedora-release-.*rO)rr&rwrx)r5rr8r8r9fedora_versions  zFedoraPolicy.fedora_versionrb) rcrdrerrfrgrrGrrnr$rrrr8r8r6r9rEfs rE)(r0r*rUsos.report.pluginsrsos.presets.redhatrrrrrrr r r r sos.policies.distrosr rr!sos.policies.package_managers.rpmr%sos.policies.package_managers.flatpakrsos.policies.package_managersr sos.utilitiesrrrrrrr RH_API_HOSTrrCrBrDrEr8r8r8r9s(  0     } [X