File: //usr/lib64/python3.9/site-packages/rhsmlib/dbus/objects/__pycache__/attach.cpython-39.pyc
a
X�Zh � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m
Z
d dlmZm
Z
mZmZ d dlmZ d dlmZ d d lmZ e� e�e�ZG d
d� de
j�ZG dd
� d
e
j�ZdS )� )�ListN)�
UEPConnection)�
entcertlib)�Locale)� constants�base_object�util�
dbus_utils)�
AttachService)�init_dep_injection)�is_simple_content_accessc @ s: e Zd Zeeed�dd�Zee eeee d�dd�ZdS )�AttachDBusImplementation)�
service_level�
proxy_options�returnc
C s� | � � | j|dd�}t|d�r*t�d� t|�}z|�|�}W n< ty| } z$t�|� t �
t|���W Y d }~n
d }~0 0 t�
� �� |S )NT�Z
proxy_only��uep��Calling D-Bus method AutoAttach() is deprecated, when Simple Content Access mode is used and it will be not be supported in the next minor release of subscription-manager)�ensure_registered� build_uepr �log�infor
Zattach_auto� Exception� exception�dbus�
DBusException�strr �EntCertActionInvoker�update)�selfr r r �service�response�exc� r$ �A/usr/lib64/python3.9/site-packages/rhsmlib/dbus/objects/attach.py�auto_attach# s
�
$z$AttachDBusImplementation.auto_attach)�pools�quantityr r c
C s� | � � |dk rt�d��| j|dd�}t|d�r<t�d� t|�}z(g }|D ]}|�||�}|� |� qNW n< t
y� } z$t�| � t�t| ���W Y d } ~ n
d } ~ 0 0 t
�� �� |S )N� z#Quantity must be a positive number.Tr r r )r r r r r r r r
Zattach_pool�appendr r r r r r )
r r'