403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/uaclient/entitlements/__pycache__/__init__.cpython-38.pyc
U

2�d��@s�ddlZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZddlmZddlmZdd
lmZddlmZmZddl m!Z!ddl"m#Z#e
eeeeej$ej%eeeeegZ&d/e	e'e'd�dd�Z(d0e	e)e)ee'd�dd�Z*e	ee'ee'd�dd�Z+ej,Gdd�dej-��Z.e	ee'd�dd �Z/e	ee'd�d!d"�Z0e	eee.ee'e)fee'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�variantcCsVtD]D}||d�}||jkr|s(|S||jkr@|j|St|��qt|��dS)aReturns 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.
    �rN)�ENTITLEMENT_CLASSES�valid_namesZvariantsr)rrr�entitlement�ent�r�@/usr/lib/python3/dist-packages/uaclient/entitlements/__init__.py�entitlement_factory$s



r F)r�
allow_beta�	all_names�returncslt�jd�}||O}t}|s*dd�|D�}|rVg}|D]}|�|�d�j�q6t|�St�fdd�|D��S)aReturn 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_betacSsg|]}|js|�qSr)Zis_beta��.0rrrr�
<listcomp>Ks�z"valid_services.<locals>.<listcomp>rcsg|]}|�d�j�qS)r)Zpresentation_namer$rrrr&Ys�)rrr�extendr�sorted)rr!r"Zallow_beta_cfgZentitlements�namesrrrr�valid_services<s"
�
��r*)r�entsr#cs(t|���fdd��t|�fdd�d�S)zR
    A function to sort entitlments for enabling that preserves invalid names
    cs.z��|�WStk
r(t��YSXdS�N)�index�
ValueError�len�r)�valid_ents_orderedrr� sort_order_with_nonexistent_lasthszIorder_entitlements_for_enabling.<locals>.sort_order_with_nonexistent_lastcs�|�Sr,rr0)r2rr�<lambda>n�z1order_entitlements_for_enabling.<locals>.<lambda>)�key)�entitlements_enable_orderr()rr+r)r2r1r�order_entitlements_for_enabling`sr7c@seZdZe�Ze�ZdS)�	SortOrderN)�__name__�
__module__�__qualname__�object�REQUIRED_SERVICES�DEPENDENT_SERVICESrrrrr8qsr8)rr#cCst|tjd�S)zR
    Return the entitlements disable order based on dependent services logic.
    �r�
sort_order)�_sort_entitlementsr8r>rrrr�entitlements_disable_orderwsrBcCst|tjd�S)zP
    Return the entitlements enable order based on required services logic.
    r?)rAr8r=rrrrr6~sr6�r�ent_clsr@�visited�ordercCsv|j|krdS|tjkr$||�j}n
||�j}|D] }|j|kr2t|||||d�q2|�t|j��d|t|j�<dS)NrCT)rr8r=Zrequired_servicesZdependent_services�_sort_entitlements_visit�append�str)rrDr@rErFZcls_listZcls_dependencyrrrrG�s 



�rG)rr@r#cCs(g}i}tD]}t|||||d�q|S)NrC)rrG)rr@rFrErDrrrrA�s�rA)r)rcCsFg}|D] }|t|ddd�kr|�|�qtt|�t|��}||fS)z�Return a list of valid entitlement names.

    :param names: List of entitlements to validate
    :return: a tuple of List containing the valid and invalid entitlements
    T)rr!r")r*rHr(�set)r)rZentitlements_foundZent_name�entitlements_not_foundrrr�get_valid_entitlement_names�s�rL)rr!r#cCsNt||d�}d�|�}d�tjd|ddddd��}tjjd	d�|�|d
�S)z{
    Constructs the MESSAGE_INVALID_SERVICE_OP_FAILURE message
    based on the attempted services and valid services.
    )rr!z, �
zTry �.�PF)�widthZbreak_long_wordsZbreak_on_hyphens�enable)Z	operationZinvalid_service�service_msg)r*�join�textwrapZwraprZINVALID_SERVICE_OP_FAILURE�format)rKrr!Zvalid_services_namesrrRrrr�,create_enable_entitlements_not_found_message�s

���rV)r)FF)6�enumrT�typingrrrZuaclientrZuaclient.configrZuaclient.entitlementsrZuaclient.entitlements.anboxrZuaclient.entitlements.baser	Zuaclient.entitlements.ccr
Zuaclient.entitlements.cisrZuaclient.entitlements.esmrr
Zuaclient.entitlements.landscaperZuaclient.entitlements.livepatchrZuaclient.entitlements.realtimerZuaclient.entitlements.rosrrZuaclient.exceptionsrZ
uaclient.utilrZFIPSEntitlementZFIPSUpdatesEntitlementrrIr �boolr*r7�unique�Enumr8rBr6rGrArLZNamedMessagerVrrrr�<module>st���%�
��

Youez - 2016 - github.com/yon3zu
LinuXploit