403Webshell
Server IP : 159.223.102.202  /  Your IP : 216.73.217.92
Web Server : nginx/1.26.0
System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User : albasshbotta ( 1021)
PHP Version : 8.2.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/uaclient/entitlements/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/entitlements/__pycache__/__init__.cpython-312.pyc
�

|f	�
��ddlZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZddlmZddlmZdd
lmZddlmZmZddl m!Z!ddl"m#Z#e
eeeeejHejJejLeeeeeg
Z'd(de	de(de(fd�Z)	d)de	de*de*dee(fd�Z+de	dee(dee(fd�Z,ejZGd�dej\��Z/de	dee(fd�Z0de	dee(fd�Z1de	deed e/d!ee(e*fd"ee(f
d#�Z2de	d e/dee(fd$�Z3d%ee(de	fd&�Z4de	de*dejjfd'�Z6y)*�N)�Dict�List�Type)�
exceptions)�UAConfig)�fips)�AnboxEntitlement)�
UAEntitlement)�CommonCriteriaEntitlement)�CISEntitlement)�ESMAppsEntitlement�ESMInfraEntitlement)�LandscapeEntitlement)�LivepatchEntitlement)�RealtimeKernelEntitlement)�ROSEntitlement�ROSUpdatesEntitlement)�EntitlementNotFoundError)�is_config_value_true�cfg�name�variantc��tD]J}||��}||jvs�|s|cS||jvr|j|cSt|���t|���)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.
    �r)�entitlement_name)�ENTITLEMENT_CLASSES�valid_names�variantsr)rrr�entitlement�ents     �@/usr/lib/python3/dist-packages/uaclient/entitlements/__init__.py�entitlement_factoryr"%sg��+�I���c�"���3�?�?�"��"�"��C�L�L�(��|�|�G�,�,�.��H�H�I�#�D�
9�9��
allow_beta�	all_names�returnc�V�t|jd�}||z}t}|s|D�cgc]}|js|��}}|r6g}|D]$}|j	||��j
��&t
|�St
|D�cgc]}||��j��c}�Scc}wcc}w)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_betar)rrr�is_beta�extendr�sorted�presentation_name)rr$r%�allow_beta_cfg�entitlementsr�namess       r!�valid_servicesr/=s���*�#�'�'�3H�I�N��.� �J�&�L�� ,�
���&�&�
�
��
����'�	;�K��L�L���-�9�9�:�	;��e�}��� ,�	
��
�C� �2�2�	
����
��	
s�B!�B&�entsc�F���t|���fd��t|�fd���S)zR
    A function to sort entitlments for enabling that preserves invalid names
    c�\��	�j|�S#t$rt��cYSwxYw�N)�index�
ValueError�len)r �valid_ents_ordereds �r!� sort_order_with_nonexistent_lastzIorder_entitlements_for_enabling.<locals>.sort_order_with_nonexistent_lastis4���	+�%�+�+�C�0�0���	+��)�*�*�	+�s��+�+c����|�Sr3�)r r8s �r!�<lambda>z1order_entitlements_for_enabling.<locals>.<lambda>os
���(H��(M�r#)�key)�entitlements_enable_orderr*)rr0r8r7s  @@r!�order_entitlements_for_enablingr>as%���3�3�7��+��$�M�N�Nr#c�(�eZdZe�Ze�Zy)�	SortOrderN)�__name__�
__module__�__qualname__�object�REQUIRED_SERVICES�DEPENDENT_SERVICESr:r#r!r@r@rs�������r#r@c�8�t|tj��S)zR
    Return the entitlements disable order based on dependent services logic.
    �r�
sort_order)�_sort_entitlementsr@rFrs r!�entitlements_disable_orderrKxs���#�)�2N�2N�O�Or#c�8�t|tj��S)zP
    Return the entitlements enable order based on required services logic.
    rH)rJr@rErs r!r=r=s���#�)�2M�2M�N�Nr#�ent_clsrI�visited�orderc�V�|j|vry|tjk(r||�j}n||�j}|D]!}|j|vs�t|||||���#|j
t|j��d|t|j�<y)N�rrMrIrNrOT)rr@rE�required_services�dependent_services�_sort_entitlements_visit�append�str)rrMrIrNrO�cls_list�cls_dependencys       r!rTrT�s����|�|�w����Y�0�0�0��3�<�1�1���3�<�2�2��"����<�<�w�&�$��&�%���
��
�L�L��W�\�\�"�#�!%�G�C�����r#c�D�g}i}tD]}t|||||���|S)NrQ)rrT)rrIrOrNrMs     r!rJrJ�s9���E��G�&�
�� ���!���	
�
��Lr#r.c��g}|D]$}|t|dd��vs�|j|��&tt|�t|�z
�}||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/rUr*�set)r.r�entitlements_found�ent_name�entitlements_not_founds     r!�get_valid_entitlement_namesr_�sg�����0���~����
�
�
�%�%�h�/�	0�$�C��J��5G�1H�$H�I���5�5�5r#c���t||��}dj|�}djtjd|zdzddd���}t	j
d	dj|�|�
�S)z{
    Constructs the MESSAGE_INVALID_SERVICE_OP_FAILURE message
    based on the attempted services and valid services.
    )rr$z, �
zTry �.�PF)�width�break_long_words�break_on_hyphens�enable)�	operation�invalid_service�service_msg)r/�join�textwrap�wrapr�InvalidServiceOpError)r^rr$�valid_services_namesrrjs      r!�*create_enable_entitlements_not_found_errorrp�sx��*�c�j�I���)�)�0�1�K��)�)��
�
��[� �3�&��"�"�		
��K��+�+���	�	�"8�9���r#)�)FF)7�enumrl�typingrrr�uaclientr�uaclient.configr�uaclient.entitlementsr�uaclient.entitlements.anboxr	�uaclient.entitlements.baser
�uaclient.entitlements.ccr�uaclient.entitlements.cisr�uaclient.entitlements.esmr
r�uaclient.entitlements.landscaper�uaclient.entitlements.livepatchr�uaclient.entitlements.realtimer�uaclient.entitlements.rosrr�uaclient.exceptionsr�
uaclient.utilr�FIPSEntitlement�FIPSUpdatesEntitlement�FIPSPreviewEntitlementrrVr"�boolr/r>�unique�Enumr@rKr=rTrJr_�UbuntuProErrorrpr:r#r!�<module>r�s�����#�#��$�&�8�4�>�4�M�@�@�D�K�8�.����������������������":�X�:�S�:�3�:�2@E�!�	�!�#�!�8<�!�	�#�Y�!�HO�	�O��c��O�	�#�Y�O�"���"��	�	�"�
�"�
P�H�P��c��P�O�8�O��S�	�O�&�	�&�
�-�
 �&��&��#�t�)�_�	&�
��9�&�:
�H�
�)�
��S�	�
� 6�t�C�y�6�x�6�&�!)��:>�����r#

Youez - 2016 - github.com/yon3zu
LinuXploit