%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�Hcf,x���ddlZddlZddlZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
ddlmZmZmZmZmZmZmZddlmZddlmZmZddlmZmZdd	lmZm Z dd
l!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+dd
l,m-Z-ddl.m/Z/ej`�Z1ejdejfe4��Z5dZ6dZ7dZ8e'jrjte/jvejxze/jzze'j|jte/j~ej�ze/jzze'j�jte/j�ej�ze/jzze'j�jte/j�ej�ze/jzze'j�jte/j�ej�ze/jzze$j�jte/jvej�ze/jzze$j�jte/j�ej�ze/jzze6e/jvej�ze/jzze7e/jvej�ze/jzze8e/jvej�ze/jzzi
ZPdZQdZRdj�ej�ej�ej�ej���ZXdZYdZZidd�dd�dej���dd�dd�d d�d!d�d"d�d#g�d$e&j|jt�d%ej��d&i�d'g�d(d)d)d)ge'j�jtd*��d+d)d)d)gd,��d-d�Z]d.�Z^d/e
e_e	ffd0�Z`d1ed/e
e_e	ffd2�Zad1ed/e
e_e	ffd3�Zbd/e
e_e	ffd4�Zcd/e
e_e	ffd5�ZddHd1ed6eed/e
e_e	ffd7�Zfd8ee
e_e	fd9e_d/e
e_e	ffd:�Zg	dHd;e_d6eed/e
e
e_e	fehffd<�Zid=e_d/e_fd>�Zjd?eee_d/e_fd@�Zk	dIdAee
e_e_fdBee_d/ee_fdC�Zld!eed/e_fdD�ZmdHdEe
e_e	fd6eed/e_fdF�ZndG�Zoy)J�N)�OrderedDict)�datetime�timezone)�Any�Dict�List�Optional�Tuple)�event_logger�
exceptions�	livepatch�lock�messages�util�version)�_is_attached)�UA_CONFIGURABLE_KEYS�UAConfig)�get_available_resources�get_contract_information)�ATTACH_FAIL_DATE_FORMAT�PRINT_WRAP_WIDTH)�entitlement_factory)�ContractStatus�UserFacingAvailability�UserFacingConfigStatus�UserFacingStatus)�notices�state_files�user_config_file)�Notice)�TxtColor�	essential�standard�advancedz({name: <17}{available: <11}{description}zJ{name: <17}{available: <11}{entitled: <11}{auto_enabled: <16}{description}z4{name: <17}{entitled: <10}{status: <13}{description}��name�entitled�status�descriptionz4{name: <17}{entitled: <19}{status: <22}{description}z={marker} {name: <15}{entitled: <19}{status: <22}{description}�_doczUContent provided in json response is currently considered Experimental and may change�_schema_versionz0.1r�
machine_id�attachedF�	effective�expires�origin�services�execution_status�execution_details�featuresr�contract���idr'�
created_at�products�tech_support_level�account�r'r9r:�external_account_ids�	simulatedc� �|j�D�cgc]p}|jjs|jjn|jj|j
j|j
jd���rc}Scc}w)N)r'�reason_code�reason)�blocking_incompatible_services�entitlement�
is_variantr'�variant_name�	named_msg�msg)�ent�services  �1/usr/lib/python3/dist-packages/uaclient/status.py�_get_blocked_by_servicesrM�s~���9�9�;��
�
�*�*�5�5��#�#�(�(��(�(�5�5�"�,�,�1�1��'�'�+�+�	
����s�A5B�returnc
�"�d}d}|j�}|j�}|j|vrdnd}i}|tjk(rt
j}	n�|j|vr t
j}	||j}n�|j�\}	}
|	t
jk(r|
j|
jd�}n|
r|
j}|	t
jk(rd}|jr?|jj�D��cic]\}}|t||��||���}}}t|�}
|j|j |j"|	j"||||
|d�	}|j$s||d<|Scc}}w)Nr7�no�yes)�code�message��cfg)	r'r*r(r)�status_details�description_override�	available�
blocked_by�warning�variants)�status_description_override�contract_statusr'r�
UNENTITLEDr�UNAVAILABLE�INAPPLICABLE�user_facing_status�WARNINGrIr[�items�_attached_service_statusrM�presentation_namer*�valuerF)rJ�inapplicable_resourcesrUrZrVrWr]rXr[�
ent_status�detailsrG�variant_clsrY�service_statuss               rLrdrd�s����G��N��:�:�<���)�)�+�O����$:�:���I��H��.�3�3�3�%�1�1�
��8�8�-�-�)�6�6�J�#9�#�(�(�#C� �"%�"8�"8�":��J���-�5�5�5�#�L�L�&�{�{����!(�����-�:�:�:� �	��|�|�69�\�\�5G�5G�5I�
�2��k�!�":�#��,�.��#�����*�#�.�J��%�%����#�)�)��"�"�(� 4�� ��
�N��>�>�%-��z�"����5s�FrUc�v�tjtj�tjtj�t|�jr#tjtj�tjt�}|jd}|d}tjj}|j|dd|j!d�tj"�xsg|d|d|j!dd	�|j!d
g�|d�|j$j&d|j$j&d|j$j&j!dd	�|j$j&j!dg�d
�d��|j!d�r|j$j(|d<|j!d�r|d|d<|jj!d�}|st+|�}t-|d���D�cic](}|j!d�s|d|j!d���*}}|D]G}	t/||j!dd	���}||�}	|dj5t7|	||���I|dj9d���|j$j:j!di�j!d�}
|
r+|
j!di�j!d�}|r||dd <|Scc}w#t0j2$rY��wxYw)!z8Return configuration of attached status as a dictionary.�machineTokenInfo�contractInfo�	machineIdTr1r9r'�	createdAtr7r;r8�externalAccountIDsr>)r-r.r1rr6r=�effectiveTor0�
effectiveFromr/�availableResourcesc�&�|jdd�S�Nr'r7��get��xs rL�<lambda>z"_attached_status.<locals>.<lambda>s�����f�b�8I����keyrXr*�rUr'r2c�&�|jdd�Srvrwrys rLr{z"_attached_status.<locals>.<lambda>���A�E�E�&�"�,=�r|�supportrE�affordances�supportLevelr6r<)r�remover!�AUTO_ATTACH_RETRY_FULL_NOTICE�AUTO_ATTACH_RETRY_TOTAL_FAILUREr�is_attached_and_contract_valid�CONTRACT_EXPIRED�copy�deepcopy�DEFAULT_STATUS�
machine_tokenrr`rf�updaterx�list�machine_token_filer=�contract_expiry_datetimer�sortedrr�EntitlementNotFoundError�appendrd�sort�entitlements)rU�responsermrnr<�	resources�resourcerg�ent_clsrJr�r�s            rL�_attached_statusr��s���N�N�6�7�7�8��N�N�6�9�9�:��C��7�7����v�.�.�/��}�}�^�,�H��(�(�);�<��#�N�3�L�)�6�6�<�<���O�O�*�;�7��"�&�&�x�0��|�|�~�+��"�4�(�$�V�,�*�.�.�{�B�?�(�,�,�Z��<�&8���.�.�6�6�v�>��,�,�4�4�T�:�!�4�4�<�<�@�@����),�(>�(>�(F�(F�(J�(J�(�"�)�
	�	
��2���
�&�!�4�4�M�M��������(� ,�_� =�����!�!�%�%�&:�;�I��+�C�0�	��y�.I�J����|�|�K�(�	���(�,�,�}�5�5�����

��	�)��h�l�l�6�2�6��G�
�c�l�����#�#�$�S�*@�#�F�	
�

�
�Z����"=��>��$�$�1�1�5�5�i��D�H�H���G���{�{�=�"�5�9�9�.�I���9E�H�Z� �!5�6��O��5���2�2�	��	�s�(-L�L"�"L8�7L8c	���tjt�}t|�}|D]�}|j	d�rt
jj}nt
jj}	t||j	dd���}|jdk(rHtj �tj"j$k(r||�}|j'�}nd}|d	j)|j	d
|d�|j*||d����|d	j-d��
�|S#tj$r*tjd|j	dd��Y��LwxYw)z#Return unattached status as a dict.rXr'r7rz@Ignoring availability of unknown service %s from contract serverzwithout a 'name' keyr
Nr2�presentedAs)r'r*rWrXc�&�|jdd�Srvrwrys rLr{z$_unattached_status.<locals>.<lambda>Gr�r|r})r�r�r�rrxr�	AVAILABLErfr_rrr��LOG�debugr'r
�on_supported_kernel�LivepatchSupport�UNSUPPORTEDr\r�r*r�)rUr�r�r�rXr��lp�descr_overrides        rL�_unattached_statusr�sY���}�}�^�,�H�'��,�I��%
���<�<��$�.�8�8�>�>�I�.�:�:�@�@�I�	�)��h�l�l�6�2�6��G�
�L�L�K�'��-�-�/��)�)�5�5�6����B��;�;�=�N�!�N����#�#� ���]�H�V�4D�E�&�2�2�(6�&�	
�	
�=%
�L
�Z����"=��>��O��=�2�2�	��I�I�����V�%;�<�
�

�
	�s�1D7�79E4�3E4c���tj|jd��}||z}|r|Stj|�}g}|jdi�D]b}|d}	t
||��}tjj}	|jr|jdd�|	k(s�R|j|��d|r||d<|S#tj$r	|j|�Y��wxYw)z1Remove beta services from response dict if neededzfeatures.allow_beta)�config�
path_to_valuer2r'rr)r7)r�is_config_value_truerUr�r�rxrrr�r�r�ACTIVErf�is_beta)
rU�show_allr��config_allow_beta�new_response�released_resourcesr��
resource_namer��enabled_statuss
          rL�_handle_beta_resourcesr�Ls����1�1��w�w�&;���
�!�!�H�����=�=��*�L��� �$�$�Z��4�0�� ��(�
�
	�)�c�
�F�G�*�0�0�6�6�����(�,�,�x��"<��"N��%�%�h�/�!0�$�#5��Z� ����#�2�2�	�
�
�%�%�h�/��	�s�
C�%C*�)C*c���t}|jj}tj}tj�\}}tj�xsg}|dkDr8|jj}tjj||��}nRtjjr8|jj}d}tj j|��}||||j"|j$|j&d�}t(j*j,j/�}	t0D]$}
t3||
�s�|	|
��t5||
�|	|
<�&|	|dd<|S)aGReturn a dict with execution_status, execution_details and notices.

    Values for execution_status will be one of UserFacingConfigStatus
    enum:
        inactive, active, reboot-required
    execution_details will provide more details about that state.
    notices is a list of tuples with label and description items.
    r)�pid�lock_holderzconfiguration changes)�	operation)r3r4r�config_pathr�r5r��	ua_config)r�INACTIVErfr�NO_ACTIVE_OPERATIONSr�check_lock_inforr�r��	LOCK_HELD�formatr�reboot_cmd_marker_file�
is_present�REBOOTREQUIRED�ENABLE_REBOOT_REQUIRED_TMPL�cfg_pathrUr5r �user_config�
public_config�to_dictr�hasattr�getattr)rU�
userStatus�
status_val�status_desc�lock_pidr��notices_listr��retr�r~s           rL�_get_config_statusr�psP��(�J��$�$�*�*�J��/�/�K�"�2�2�4��X�{��<�<�>�'�R�L��!�|��&�&�,�,�
��(�(�/�/��k�0�
��
�	+�	+�	6�	6��.�.�4�4�
�+�	��:�:�A�A��B�
��'�(���|�|��'�'��L�L�
�C�!�,�,�:�:�B�B�D�I�#�/���3����3��!7�$�S�#�.�I�c�N�/�"+�C��M�+���Jr|r�c��t|�jrt|�}nt|�}|j	t|��t
j�rtjj|�t|||�}|s9|jdg�D�cgc]}|jdd�dk(r|��}}||d<|Scc}w)aReturn status as a dict, using a cache for non-root users

    When unattached, get available resources from the contract service
    to report detailed availability of different resources for this
    machine.

    Write the status-cache when called by root.
    r2rXrQ)
r�is_attachedr�r�r�r�r�we_are_currently_rootr�status_cache_file�writer�rx)rUr�r�rK�available_servicess     rLr)r)�s����C��$�$�#�C�(��%�c�*���O�O�&�s�+�,��!�!�#��%�%�+�+�H�5�%�c�8�X�>�H��$�<�<�
�B�7�
���{�{�;��.�%�7�
�
��
�
 2�����O��
s�Cr��entitlement_namec���|D]d}|jd�|k(s�|jd�rdnd|jdi�jd�rdnd|jdi�d�cSddid�S)	z0Extract information from the entitlements array.�typer(rQrP�obligations�enableByDefaultr�)r(�auto_enabledr�rw)r�r�rEs   rL�_get_entitlement_informationr��s���$����?�?�6�"�&6�6�%0�_�_�Z�%@�E�d�#���}�b�9�=�=�)����*���}�b�A�
�

���d�2�F�Fr|�tokenc
�n	�d}tjt�}	t||�}|jdi�}|jdi�}|j|jdd�|jd	d�|jd
d�|jdg�d�|jd	d�|jd�|jd
d�|jd
g�d�dd��tjtj�}	|jd�r�|jd�|d<|d}
|
|	z
}|j�dkr�t j"j%|dd|
j't(���}t*j-|j.|j0��t*j3t j4dz|j.zdz�d}|jd�r�|jd�|d<|d}
|	|
z
}|j�dkr�t j6j%|dd|
j't(���}t*j-|j.|j0��t*j3t j4dz|j.zdz�d}t9|�}t;|d���D�cgc]}|ds|d	��}}|jdg�}|D]�}|jd	d�}	t=||��}||��}tA||�}|d jC|jd!|j0�|jD|d"|d#|j0|vrd$nd%d&����|d jGd'���tA|d(�}|d"r|d)jd*�}|r||dd+<|jtI|��tK|||�}|s9|jd g�D�cgc]}|jdd$�d$k(r|��}}||d <||fS#tj
$r6}t
|d�r#|jdk(rt	j��|�d}~wwxYwcc}w#tj>$rY���wxYwcc}w),z�Get a status dictionary based on a token.

    Returns a tuple with the status dictionary and an integer value - 0 for
    success, 1 for failure
    rrRi�Nrn�accountInfor9r7r'rpr;)r9r'r:r;rqr>T)r6r=r@rrr0r6)�contract_id�date)�	error_msg�
error_code�
�rsr/c��|dS)Nr'�rys rLr{z!simulate_status.<locals>.<lambda>s
���&�	�r|r}rX�resourceEntitlementsrrTr2r�r(r�rQrP)r'r*r(r�rXc�&�|jdd�Srvrwrys rLr{z!simulate_status.<locals>.<lambda>3r�r|r�r�r�r<)&r�r�r�rr�ContractAPIErrorr�rR�AttachInvalidTokenErrorrxr�r�nowr�utc�
total_secondsr�E_ATTACH_FORBIDDEN_EXPIREDr��strftimer�event�errorrIr'�info�STATUS_TOKEN_NOT_VALID�E_ATTACH_FORBIDDEN_NOT_YETrr�rr�r�r�r*r�r�r�)rUr�r�r�r��contract_information�e�
contract_info�account_infor��expiration_datetime�deltarS�effective_datetimer�r�rgr�r�r�rJ�entitlement_informationr�r�rKr�s                          rL�simulate_statusr��s����C��}�}�^�,�H��7��U�C��)�,�,�^�R�@�M�'�+�+�M�2�>�L��O�O�$�'�'��b�1�%�)�)�&�"�5�+�/�/��R�@�)�-�-�j�"�=�	�%�(�(���4�"�&�&�t�,�*�.�.�{�B�?�(4�(8�(8�(�"�)�	��	
��(�,�,�x�|�|�
$�C�����'�+�/�/�
�>����&�y�1��#�c�)����� �A�%��9�9�@�@�$�Z�0��6�(�1�1�2I�J�A��G�
�K�K�'�+�+�'�,�,�K�G��J�J��/�/�$�6����D�t�K�
��C�����)� -� 1� 1�/� B����%�k�2���(�(����� �A�%��9�9�@�@�$�Z�0��6�'�0�0�1H�I�A��G�
�K�K�'�+�+�'�,�,�K�G��J�J��/�/�$�6����D�t�K�
��C�'��,�I��y�.A�B�����$�	������!�$�$�%;�R�@�L��
��#�<�<���3��	�)�c�8H�I�G��#���">��*�#
��	���#�#� ���]�C�H�H�=�"���3�J�?� 7�� G� �X�X�-C�C�E��

�
	
�
�*
�Z����"=��>�*�<��C�G��z���}�-�1�1�.�A���9E�H�Z� �!5�6��O�O�&�s�+�,�%�c�8�X�>�H��$�<�<�
�B�7�
���{�{�;��.�%�7�
�
��
�
 2�����S�=���U�&�&���1�f��!�&�&�C�-��4�4�6�6������v���2�2�	��	��:
s5�Q�'R�$
R�R2�R�1R�R�R/�.R/�stringc�n�tjj�rtj	||�S|S)z=Return colorized string if using a tty, else original string.)�sys�stdout�isatty�STATUS_HUMANIZE_COLORIZErx)rs rL�for_human_colorizedrIs5���:�:����	!�$�$�V�V�4���r|�commandsc�$�d}|D]}|r|dz
}|dj|�z
}�djtj|tdz
d���}d|vrd	}d
}nd}d}d
j	t
j|||t
j��S)Nr7z && � z \
�z  )�width�subsequent_indentr�z{
  z
}z{ z }z%{color}{prefix}{content}{suffix}{end})�color�prefix�content�suffix�end)�join�textwrap�wraprr�r"�DISABLEGREY�ENDC)rr�cmd�wrapped_contentrrs      rL�colorize_commandsrRs����G��!����v��G��3�8�8�C�=� ��!��l�l��
�
��,�q�0�T�	
��O�
�����������2�9�9��"�"�����M�M�:��r|�column_data�headerc	�d�g}|r|j|�t|D�cgc]}t|d���c}�}|dkDr?dj|�}|j	|D�cgc]}|j|���c}�|S|j	|D�cgc]}|d��	c}�|Scc}wcc}wcc}w)z�Return a list of content lines to print to console for a section

    Content lines will be center-aligned based on max value length of first
    column.
    rz{{:>{}}}: {{}}r�)r��max�lenr��extend)rrr�pair�template_length�templates      rL�get_section_column_contentr#ns����G�
����v���K�@�D�3�t�A�w�<�@�A�O����#�*�*�?�;�����;�G�4������.�G�H��N�	���K�8�D��Q��8�9��N��A��H��9s�B#� B(�B-c��|�tjS	|j�}|j	d�S#t$rY�wxYw)Nz%c %Z)r�STATUS_CONTRACT_EXPIRES_UNKNOWN�
astimezone�	Exceptionr�)r0s rL�format_expiresr(�sM�����7�7�7�
��$�$�&�����G�$�$���
��
�s�5�	A�Ar)c�X�|jd��sg|jd�r�|jdd�stjStj	tj
tjtjtjtj��g}|jdg�D]&}|jtjd)i|����(dj|�S|jdd�stjg}n�tj	tj
tjtj��g}|jdg�D]�}|jd�}|r|n|jd	d
�}|jd�dk(rtjntj}|jtj	|jd
d
�||�����|jd�}|r0|jtj�|j!|�|jd�rt|jdtj"z�t%|jdi�j'��D]&\}}	|jdj	||	���(|s!|j!d
tj(g�|j!d
tj*j,g�t/j0�t.j2j4k(r!|j!d
tj6g�dj|�Sg}
d}|jdd�stjg}�n�t8g}|jdg�D�]�}|jdd
�}
|jd�}|r|n|jd	d
�}|jd
d
�t;|
�t;|jdd
��|d�}|jdd�}|�%|jdd�}|�|
j|�|jd�}|r|sd}dj	|d
�|d
<|jt=jd)i|���|s��|s��	t?|j'��D]�\}\}}|tA|�dz
k7rdnd}|jtBj	||jd
�t;|jdd
��t;|jdd
��|jd	d
���������|r0|jd
�|jtjD�|jd�stA|
�dkDrs|jd
�|jtj�|jd�}|r|j!|�tA|
�dkDr|j!|
�|jd�rt|jdtj"z�t%|jdi�j'��D]&\}}	|jdj	||	���(|jd
�|sA|r |jtjF�n|jtj(�|jtjHj	d� ��g}|jd!i�jd
d"�}|r!|jtjJ|f�|jd#i�jd
d"�}|r!|jtjL|f�|jd$d�d%k7r�|jtjNtQ|jd&��f�|jd#i�jd'd"�}|jtjRt;|�f�|r,|jd
�|j!tU|�(��dj|�S)*z&Format status dict for tabular output.r.r@r2N)r'rXr(r�r*r�)r'rXr*rWr*r7rXrQr'rr5z{}: {}Fr(r)r&rZrSr[Tz{}*r�u├u└)�markerr'r(r)r*rzpro enable <service>)�commandr=�unknownr6r1�freer0r<)rr�)+rxr�STATUS_NO_SERVICES_AVAILABLE�STATUS_SIMULATED_TMPLr��STATUS_SERVICE�STATUS_AVAILABLE�STATUS_ENTITLED�STATUS_AUTO_ENABLED�STATUS_DESCRIPTIONr�r�STATUS_UNATTACHED_TMPL�STANDALONE_YES�
STANDALONE_NO�STATUS_NOTICESr�STATUS_FEATURESr�rc�STATUS_ALL_HINT�E_UNATTACHEDrIr
r�r�r��)LIVEPATCH_KERNEL_NOT_SUPPORTED_UNATTACHED�
STATUS_HEADERr�STATUS_TMPL�	enumerater�VARIANT_STATUS_TMPL�STATUS_SERVICE_HAS_VARIANTS�STATUS_ALL_HINT_WITH_VARIANTS�"STATUS_FOOTER_ENABLE_SERVICES_WITH�STATUS_FOOTER_ACCOUNT�STATUS_FOOTER_SUBSCRIPTION�STATUS_FOOTER_VALID_UNTILr(�STATUS_FOOTER_SUPPORT_LEVELr#)r)r�rrKr�r*rXrr~rf�service_warnings�has_variantsrkr(�fmt_argsrZ�warning_messager[�idx�_�variantr*�pairs�account_name�
contract_namer<s                          rL�format_tabularrR�sb���:�:�j�!��:�:�k�"��:�:�j�$�/��<�<�<�&�,�,�!�0�0�&�7�7�%�5�5�!)�!=�!=� (� ;� ;�-���G�"�:�:�j�"�5�
H�����4�;�;�F�g�F�G�
H��9�9�W�%�%��z�z�*�d�+��<�<�=�G�'�-�-�!�0�0�&�7�7� (� ;� ;�.���G�"�:�:�j�"�5�
��!(���-C�!D��&�#� ���]�B�7���{�{�;�/�5�8��+�+�!�/�/��
���*�1�1�$�[�[���4�"+�$/�2���
�(�*�*�Y�'����N�N�8�2�2�3��N�N�7�#��:�:�j�!��N�N�4�(�":�":�:�;�$�V�Z�Z�
�B�%?�%E�%E�%G�H�
<�
��U����x���s�E�:�;�
<���N�N�B�� 8� 8�9�:�����H�1�1�5�5�6�7��)�)�+��)�)�5�5�
6�
�N�N��X�G�G�H�
��y�y��!�!����L��:�:�j�$�'��8�8�9�� �/��$�j�j��R�8�*	�N�%�)�)�*�b�9�H�+�/�/�0F�G�N�"��#�'�'�
�r�:�
�'�*�*�6�2�6�/��9�-�"�&�&�x��4�� +�
�H�%�(�(��D�9�G��"�")�+�+�i��">��"�.�$�+�+�O�<�%�)�)�*�5�H���#��#(�<�<���0@�#A��� ��N�N�;�-�-�9��9�:��H�)2�8�>�>�3C�)D��%�C��!�W�&)�S��]�Q�->�&>�U�E�F��N�N�+�2�2�#)�!(���V�!4�%8� '���J�� ;�&�$7� '���H�b� 9�$�)0���M�2�(F�3�
���9*	�X����r�����x�;�;�<�
�z�z�)���$4� 5�� 9����r�����x�.�.�/��*�*�Y�'����N�N�7�#��� �1�$��N�N�+�,�
�z�z�*�����t�h�6�6�6�7� ����J��!;�!A�!A�!C�D�	8�J�C���N�N�8�?�?�3��6�7�	8��N�N�2�����N�N�8�A�A�B��N�N�8�3�3�4��N�N��3�3�:�:�*�	;�	
��

�E��:�:�i��,�0�0���C�L��
���h�4�4�l�C�D��J�J�z�2�.�2�2�6�9�E�M��
���h�9�9�=�I�J�
�z�z�(�D�!�V�+�
����2�2��v�z�z�)�4�5�
�	
�$�Z�Z�
�B�7�;�;� �)�
��	����4�4�#�$6�7�
�	
�
����r�����1�e�D�E��9�9�W��r|c�T�t|�}d}t�}||d<|D];}|d|k(s|jd�|k(s� 	t||d��}|}||�}n|�t	j|���t|�jr6ti|�}|d}	|d|d<|	|d<|	dk(rQjrEd	|d
<n?|drtjj}
ntjj}
|
|d<j|d<|S#tj
$rY��wxYw)
z�Return help information from an uaclient service as a dict

    :param name: Name of the service for which to return help data.

    :raises: UbuntuProError when no help is available.
    Nr'r�r)r'r)r(�enabledT�betarX�help)rrrxrrr��
NoHelpContentrr�rdr�rr�rfr_�	help_info)rUr'r��
help_resource�
response_dictr��help_ent_cls�help_entrk�
status_msgrXs           rLrVrVIsW��(��,�I��M�
 �M�M� �M�&���
���F��t�#�x�|�|�M�'B�d�'J�
�2��(�6�"2� ��
%�M�#�C�(�H��
����&�&�D�1�1��C��$�$�1�(�B��D��#�H�-�
�$2�:�$>�
�j�!�",�
�h����"�|�';�';�$(�M�&�!���%�.�8�8�>�>�I�.�:�:�@�@�I�%.�
�k�"�$�.�.�M�&�����9�6�6�
��
�s�D�D'�&D')F)N)pr��loggingrr�collectionsrrr�typingrrrr	r
�uaclientrrr
rrrr�(uaclient.api.u.pro.status.is_attached.v1r�uaclient.configrr�uaclient.contractrr�uaclient.defaultsrr�uaclient.entitlementsr�(uaclient.entitlements.entitlement_statusrrrr�uaclient.filesrrr �uaclient.files.noticesr!�uaclient.messagesr"�get_event_loggerr��	getLogger�replace_top_level_logger_name�__name__r��	ESSENTIAL�STANDARD�ADVANCEDr�rf�OKGREEN�STATUS_STATUS_ENABLEDrr��FAIL�STATUS_STATUS_DISABLEDr`r�STATUS_STATUS_INAPPLICABLEr_�STATUS_STATUS_UNAVAILABLErb�
WARNINGYELLOW�STATUS_STATUS_WARNING�ENTITLED�STATUS_ENTITLED_ENTITLEDr^�STATUS_ENTITLED_UNENTITLED�STATUS_SUPPORT_ESSENTIAL�STATUS_SUPPORT_STANDARD�STATUS_SUPPORT_ADVANCEDrr5r/r�r0r2�
STATUS_STATUSr4r=r>r@�get_versionr�r�rM�strrdr�r�r�r��boolr)r��intr�rrr#r(rRrVr�r|rL�<module>r�s�����
��#�'�3�3����B�:�O�G�5���B�A�)�&�%��%�%�'���g���:��:�:�8�D�E��
�	�����
���!�!����8�9�9�9�H�M�M�I����#�#��
�
��7�7�7�(�-�-�G��!�!�'�'����
�
-�
-�	.�
�-�-�	�� � �&�&����
�
,�
,�	-�
�-�-�	����"�"�����!?�!?�?�(�-�-�O����!�!����8�<�<�<�x�}�}�L����#�#����
�
-�
-�	.�
�-�-�	��x����'�'�(��m�m��
�h����&�&�'��m�m��
�h����&�&�'��m�m��E%��PD��N��G�M�M�	�	 �	 �
�
%�
%��!�!��+�+�	N��
�E��C���
�
#���u���"�w�"�"�$�	�
�$����
�����t��
�d������.�7�7�=�=����6�6������r�������.�;�;�A�A���,���� "�	�-�8��9��@�8�	�#�s�(�^�8�vG�(�G�t�C��H�~�G�T.�H�.��c�3�h��.�b!�t�C��H�~�!�H(�t�C��H�~�(�V���D��T�#�s�(�^��@G��t�C��H�~�&�G�:=�G�	�#�s�(�^�G�*',�w��w�#�w�
�4��S��>�3���w�t�������T�#�Y���C��:AE���e�C��H�o�&��08��
��	�#�Y��*%�H�X�.�%�3�%�y�4��S��>�y�T�y�c�y�x2r|

Zerion Mini Shell 1.0