HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib64/python3.9/site-packages/rhsmlib/services/__pycache__/attach.cpython-39.opt-1.pyc
a

X�Zh��@s<ddlZddlmZddlmZe�e�ZGdd�d�Z	dS)�N)�	injection)�
UEPConnectionc@sDeZdZdZedd�dd�Zdeed�dd�Zee	ed	�d
d�Z
dS)
�
AttachServicez@
    Service using for attach pools by ID or auto-attaching
    N)�cp�returncCs&t�tj�|_t�tj�|_||_dS)N)�injZrequireZPLUGIN_MANAGER�plugin_managerZIDENTITY�identityr)�selfr�r�=/usr/lib64/python3.9/site-packages/rhsmlib/services/attach.py�__init__szAttachService.__init__)�
service_levelrcCsh|dur*|jj|jj|d�t�d|�|jjd|jjd�|j�|jj�}|jjd|jj|d�|S)a6
        Try to perform auto-attach. Candlepin server tries to attach pool according
        installed product certificates and other attributes (service_level, syspurpose, etc.)
        :param service_level: String with requested service level
        :return: Dictionary with result of REST-API call
        N)rzService level set to: %sZpre_auto_attach)�
consumer_uuidZpost_auto_attach�rZentitlement_data)	rZupdateConsumerr	�uuid�log�debugr�runZbind)r
r�resprrr�attach_autos��zAttachService.attach_auto)�pool�quantityrcCsF|jjd|jj||d�|j�|jj||�}|jjd|jj|d�|S)z�
        Try to attach pool
        :param pool: String with pool ID
        :param quantity: Quantity of subscriptions user wants to consume
        :return: Dictionary with result of REST-API call
        Z
pre_subscribe)rZpool_idrZpost_subscriber)rrr	rrZbindByEntitlementPool)r
rrrrrr�attach_pool=s
��zAttachService.attach_pool)N)�__name__�
__module__�__qualname__�__doc__rr
�str�dictr�intrrrrrrsr)
ZloggingZsubscription_managerrrZrhsm.connectionrZ	getLoggerrrrrrrr�<module>
s