File: //usr/lib64/python3.9/site-packages/rhsmlib/dbus/__pycache__/base_object.cpython-39.pyc
a
X�Zh� � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dl m
Z
d dlmZm
Z
mZ d dlmZ d dlZer�d dlmZ d d lmZ d d
lmZ d dlmZ e
� e �e�ZG dd
� d
�ZG dd� dejj�Z dS )� N)�
TYPE_CHECKING)�utils)� injection)�init_dep_injection)� constants�
exceptions�util)�config)�BusName)�
UEPConnection)�
CPProvider)�Identityc @ sR e Zd ZdZed�dd�Zdd�dd�Zedd�d d
�Zdeeedd
�dd�Z dS )�BaseImplementationz�Core implementation for subscription-manager D-Bus API.
This base class allows us to contain useful functions in one place, without
having to duplicate the work. Individual D-Bus object implementations
subclass this base.
)�returnc C s t �t j�}|�� S )zHUses the Identity class to determine if the system is registered or not.)�inj�requireZIDENTITYZis_valid)�self�identity� r �>/usr/lib64/python3.9/site-packages/rhsmlib/dbus/base_object.py�
is_registered- s z BaseImplementation.is_registeredNc C s | � � st�d��dS )z8Raise a D-Bus exception if the system is not registered.zIThis object requires the consumer to be registered before it can be used.N)r �dbusZ
DBusException)r r r r �ensure_registered2 s �z$BaseImplementation.ensure_registered)�
proxy_optionsr c C s, |� � D ]}|dvrt�d|� d���qdS )z�Ensure that the dictionary only contains keys related to proxy configuration.
:raises exceptions.Failed: Some key is not a proxy option.
)�proxy_hostname�
proxy_port�
proxy_user�proxy_password�no_proxyzError: z is not a valid proxy optionN)�keysr ZFailed)r r �keyr r r �_validate_only_proxy_options9 s z/BaseImplementation._validate_only_proxy_optionsFr )�options�
proxy_only�basic_auth_methodr c C sP t �tj �� �}t�tj�}|r*| �|� i }|d }|�d|d �|d<