PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/uaclient/api/u/pro/security/status/reboot_required/__pycache__

Просмотр файла: v1.cpython-310.pyc

o

Uٵg�@sddlmZddlmZmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZddlmZmZmZGd	d
�d
e�ZGdd�dee�ZGd
d�de�Zdd�Zdefdd�Zde
defdd�Ze	ddedd�Zdddegddd �ZdS)!�)�Enum)�List�Optional)�
exceptions�	livepatch)�APIEndpoint)�AdditionalInfo)�UAConfig)�
BoolDataValue�
DataObject�Field�StringDataValue�	data_list)�get_kernel_info�get_reboot_required_pkgs�
should_rebootc@sVeZdZedee�ddd�edee�ddd�gZdeee	deee	fdd�Z
d	S)
�RebootRequiredPkgs�standard_packagesFz)Non-kernel packages that require a reboot��doc�kernel_packagesz%Kernel packages that require a rebootcCs||_||_dS�N�rr)�selfrr�r�W/usr/lib/python3/dist-packages/uaclient/api/u/pro/security/status/reboot_required/v1.py�__init__&s
zRebootRequiredPkgs.__init__N)�__name__�
__module__�__qualname__rrr
�fieldsrr�strrrrrrrs&���
�
�rc
@s�eZdZededd�ededd�ededd�eded	d�ed
eddd�ed
eddd�gZdedede	de	d
e
ed
e
efdd�ZdS)�RebootRequiredResult�reboot_requiredz7Either 'yes', 'no', or 'yes-kernel-livepatches-applied'r�reboot_required_packagesz"The packages that require a reboot�$livepatch_enabled_and_kernel_patchedz(True if livepatch is enabled and working�livepatch_enabledzTrue if livepatch is enabled�livepatch_stateFz:The state of livepatch as reported by the livepatch client�livepatch_supportz+Whether livepatch covers the current kernelcCs(||_||_||_||_||_||_dSr�r#r$r%r&r'r()rr#r$r%r&r'r(rrrrSs	�
zRebootRequiredResult.__init__N)rrrrr
rr
r r!�boolrrrrrrr"/s^�������#������r"c@seZdZdZdZdZdS)�RebootStatus�yes�nozyes-kernel-livepatches-appliedN)rrr�REBOOT_REQUIRED�REBOOT_NOT_REQUIRED�!REBOOT_REQUIRED_LIVEPATCH_APPLIEDrrrrr+fsr+cCs�t�stjSt�}|stjS|jrtjS|jrt��stjSt	�j
}zt��}Wn
tj
y5tjYSw|dur\|dur\||jkr\|jdur\|jjdksT|jjdkr\|jdkr\tjStjS)N�applied�nothing-to-apply�	supported)rr+r/rr.rrr�is_livepatch_installedr�proc_version_signature_version�statusr�ProcessExecutionError�kernel�stater3r0)�reboot_required_pkgs�our_kernel_version�	lp_statusrrr�_get_reboot_statusls6��
�


r=�returncCs
tt��Sr)�_reboot_requiredr	rrrrr#�s
r#�cfgcCs�t�}t�}t��}|sd}d}d}d}nd}|j}|jr!|jjnd}|dvr.|dkr.d}nd}t|jt|r9|j	nd|r?|j
ndd�||||d�S)a�
    This endpoint informs if the system should be rebooted or not. Possible
    outputs are:

    #. ``yes``: The system should be rebooted.
    #. ``no``: There is no known need to reboot the system.
    #. ``yes-kernel-livepatches-applied``: There are Livepatch patches applied
       to the current kernel, but a reboot is required for an update to take
       place. This reboot can wait until the next maintenance window.
    FNT)r1r2r3rr))r=rrr6r3r9r"�valuerrr)r@�
reboot_statusr:�livepatch_statusr%r&r'r(rrrr?�sB
������r?�v1�RebootRequiredN)�version�name�fn�options_clsz27.12Fzo
from uaclient.api.u.pro.security.status.reboot_required.v1 import reboot_required

result = reboot_required()
z0pro api u.pro.security.status.reboot_required.v1zD
{
    "reboot_required": "yes|no|yes-kernel-livepatches-applied"
}
)�
introduced_in�requires_network�example_python�result_classr�example_cli�example_json) �enumr�typingrr�uaclientrr�uaclient.api.apir�uaclient.api.data_typesr�uaclient.configr	�uaclient.data_typesr
rrr
r�uaclient.systemrrrrr"r+r=r#r?�endpoint�_docrrrr�<module>s87/9�
�

Выполнить команду


Для локальной разработки. Не используйте в интернете!