| Server IP : 172.67.131.151 / Your IP : 104.23.197.56 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/uaclient/entitlements/__pycache__/ |
Upload File : |
U
2�d� � @ s� d dl Z d dlZd dlmZmZmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZ d dlmZ d d lmZ d d
lmZmZ d dlmZ d dlmZ d d
lmZ d dlmZmZ d dl m!Z! d dl"m#Z# e
eeeeej$ej%eeeeegZ&d/e e'e'd�dd�Z(d0e e)e)ee' d�dd�Z*e ee' ee' d�dd�Z+e j,G dd� de j-��Z.e ee' d�dd �Z/e ee' d�d!d"�Z0e ee e.ee'e)f ee' d#�d$d%�Z1e e.ee' d&�d'd(�Z2ee' e d)�d*d+�Z3e e)ej4d,�d-d.�Z5dS )1� N)�Dict�List�Type)�messages)�UAConfig)�fips)�AnboxEntitlement)�
UAEntitlement)�CommonCriteriaEntitlement)�CISEntitlement)�ESMAppsEntitlement�ESMInfraEntitlement)�LandscapeEntitlement)�LivepatchEntitlement)�RealtimeKernelEntitlement)�ROSEntitlement�ROSUpdatesEntitlement)�EntitlementNotFoundError)�is_config_value_true� )�cfg�name�variantc C sV t D ]D}|| d�}||jkr|s(| S ||jkr@|j| S t|��qt|��dS )a Returns a UAEntitlement class based on the provided name.
The return type is Optional[Type[UAEntitlement]].
It cannot be explicit because of the Python version on Xenial (3.5.2).
:param cfg: UAConfig instance
:param name: The name of the entitlement to return
:param not_found_okay: If True and no entitlement with the given name is
found, then returns None.
:raise EntitlementNotFoundError: If not_found_okay is False and no
entitlement with the given name is found, then raises this error.
�r N)�ENTITLEMENT_CLASSES�valid_namesZvariantsr )r r r �entitlement�ent� r �@/usr/lib/python3/dist-packages/uaclient/entitlements/__init__.py�entitlement_factory$ s
r F)r �
allow_beta� all_names�returnc sl t � jd�}||O }t}|s*dd� |D �}|rVg }|D ]}|�|� d�j� q6t|�S t� fdd�|D ��S )a Return a list of valid (non-beta) services.
:param cfg: UAConfig instance
:param allow_beta: if we should allow beta services to be marked as valid
:param all_names: if we should return all the names for a service instead
of just the presentation_name
zfeatures.allow_betac S s g | ]}|j s|�qS r )Zis_beta��.0r r r r �
<listcomp>K s �z"valid_services.<locals>.<listcomp>r c s g | ]}|� d �j �qS )r )Zpresentation_namer$ r r r r&