%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�Hcf$����ddlZddlZddlZddlmZmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZddlmZmZddlmZej4ej6e��Zdej<d	ed
eedeeded
efd�Z ejBejDejFejH�ejJd�d�����Z&dej<fd�Z'y)�N)�Dict�List)	�api�config�contract�entitlements�event_logger�
exceptions�messages�status�util)�ServiceWithDependencies�
_dependencies)�_enabled_services)�cli_util�	constants)�CanDisableFailure�cfg�service�all_dependencies�enabled_service_names�called_name�
service_titlec��g}|D]\}|j|k(s|j|vr�!|jD]-}|j|k(s�|j|j��/�^|D]f}	tj||	�}
t
jj||
��}tj|��r�Qtj||
���y)N)�service_being_disabled�dependent_service)�msg)�name�
depends_on�appendr�	get_titler�DEPENDENT_SERVICE�formatr
�prompt_for_confirmationr
�DependentServiceStopsDisable)rrrrrr�dependent_services�s�requirementr�dependent_service_title�user_msgs            �6/usr/lib/python3/dist-packages/uaclient/cli/disable.py�prompt_for_dependency_handlingr,s�����
�2���6�6�W�����.C� C���<�<�	2�K����7�*�"�)�)�!�&�&�1�	2�2�0���".�"8�"8��"�#
���-�-�4�4�#0�5�5�
���+�+��9��9�9�'4�"9��
��zpro disablec
�
�g}g}g}g}tjddd�}|jdk(}tj|�}	|j
r#|jrtjdd���t|dg�}
tj|
|�\}}t|�jD�
cgc]}
|
j��}}
t|�j }d	}|D�]�}tj"||�
�}|||j|j
��}|j$}|�|}|js&	t'||j||||j(�
�|rt7j8�}n't7j8tj:��}|j=�|_	|jA|�\}}tCjB|��|s�d}|jE|�|��tG|tH�r�|jJ��|	|jJj0�|jEd|j|jJj0|jJjd��nN|jE|�|jM�}|r+d	|d<|	t2jNjd������|r�d}ddjWtjX|d	���zdz}djWt[j\|ddd���}tj^ddjW|�|��}|	|j0�|jEdd|j0|jR|jTd��tajb|�}|je�|rl|jg�|jg�|rdnd|d <||d!<||d"<||d#<||d$<titkjl|tnjpd	�%��|rd&Sd'Scc}
w#tj*$rd}t,j/|�|	|j0�|	t2j4j|j(���d}Yd}~���d}~wwxYw#tj*$r�}d}|jE|�|	|j0�|	t2jPj|j(���|jEd|j|j0|jR|jTd��Yd}~��nd}~wwxYw)(zbPerform the disable action on a list of entitlements.

    @return: 0 on success, 1 otherwise
    �successF)�_schema_version�result�needs_reboot�json�--purge�--assume-yes)�option1�option2rT)rr)�
assume_yes�purgeN)rr)�title�r)�typer�message�message_coder2zdisable operation)�	operation)r<rr=r>�additional_infozTry �, )r�
allow_beta�.�
�P)�width�break_long_words�break_on_hyphens�disable)r?�invalid_service�service_msg�system�failurer1�processed_services�failed_services�errors�warnings)�cls�	sort_keysr�)9r	�JSON_SCHEMA_VERSIONr#r�&create_interactive_only_print_functionr9r8r
�InvalidOptionCombination�getattrr�get_valid_entitlement_namesr�enabled_servicesrr�services�entitlement_factory�enabled_variantr,r:�UbuntuProError�LOG�	exceptionrr�
ENABLE_FAILEDr�ProgressWrapper�CLIEnableDisableProgress�calculate_total_disable_steps�total_stepsrIrr �
isinstancerr=�_check_for_reboot�ENABLE_REBOOT_REQUIRED_TMPL�DISABLE_FAILED_TMPL�msg_coder@�join�valid_services�textwrap�wrap�InvalidServiceOpErrorr�UAContractClient�update_activity_token�sort�printr3�dumpsr
�DatetimeAwareJSONEncoder)�argsr�kwargsrNrOrPrQ�
json_response�json_output�interactive_only_print�names�entitlements_found�entitlements_not_foundr'rr�ret�ent_name�ent_cls�ent�variant�e�progress�disable_ret�reason�ent_reboot_required�valid_namesrK�err�contract_clients                              r+�action_disabler�;s������O�
�F��H�(�;�;����M��+�+��'�K�
&�L�L�����z�z�d�o�o��1�1��~�
�	
�
�D�)�R�(�E�	�0�0���<����*�#�.�?�?���������%�S�)�2�2��
�C�&�O���2�2�s��J���c�d�o�o�T�Z�Z�H���%�%�����C����
�.���H�H�$�)� (�"%�)�)�
�"��*�*�,�H��*�*�8�+L�+L�+N�O�H�"�@�@�B���-	�"%�+�+�h�"7��K���M�M�c�"�����&�&�x�0��%�*��-�+��~�~�1�.�v�~�~�/A�/A�B��
�
�(1�+.�8�8�+1�>�>�+=�+=�06���0C�0C�	��#�)�)�(�3�&)�&;�&;�&=�#�&�48�M�.�1�*� �<�<�C�C�&9�D����wO�b�����i�i��3�3���M�N�
O��
�	�
�i�i��M�M���!&�!&�	
�
���.�.�� �I�I�&<�=�#�
��
	�s�w�w�'��
�
� ���7�7� #���#&�#6�#6�
�	
��/�/��4�O��)�)�+�����!�����/2�)�	�
�h��.@�
�*�+�+:�
�'�(�"(�
�h��$,�
�j�!�
��J�J���1�1��
�	
��1�����W��4�,�,�
��
�
�a� �&�q�u�u�-�&��*�*�1�1��	�	�1�B������
��X�(�(�	��C��"�"�8�,�"�1�5�5�)�"��,�,�3�3�#�)�)�3�D�
�
�M�M�%�"�x�x� �u�u�$%�J�J�'(�'8�'8��
�
��	�s9�-P�2%P"�+DR�"R�5AR�R�U�/BU	�	Uc�T�|jdtj��}|jt��t
jjt
jd��}tj|_
||_d|_tj|j_tj |j"_|j%dddtj&jd	j)t+j,|�
������|j%d
dtj.jd����|j%ddddgdtj0jd����|j%ddtj2��|S)z5Build or extend an arg parser for disable subcommand.rI)�help)�actionzdisable <service> [<service>])r�commandr�store�+rAr;)�options)r��nargsr�r5�
store_true)r�)r�r�z--format�clir3)�default)r��choicesr�r�r4)�
add_parserr�CLI_ROOT_DISABLE�set_defaultsr�r�
USAGE_TMPLr#�NAME�CLI_DISABLE_DESC�description�usage�prog�CLI_ARGS�_positionalsr:�	CLI_FLAGS�
_optionals�add_argument�CLI_DISABLE_SERVICErkrrl�CLI_ASSUME_YES�CLI_FORMAT_DESC�	CLI_PURGE)�
subparsersr�parserr�s    r+r�r��s~��
�
"�
"�9�8�3L�3L�
"�
M�F�
���~��.�� � �'�'�
�^�^�%D�
(�
�E�"�2�2�F���F�L��F�K� (� 1� 1�F����&�0�0�F����
�������(�(�/�/��	�	�,�"=�"=�#�"F�G�
0�
��	������
�
$�
$�
+�
+�I�
+�
>���
���������
�
%�
%�
,�
,�U�
,�
;��������
�
�
���
�Mr-)(r3�loggingrm�typingrr�uaclientrrrrr	r
rrr
�+uaclient.api.u.pro.services.dependencies.v1rr�-uaclient.api.u.pro.status.enabled_services.v1r�uaclient.clirr�(uaclient.entitlements.entitlement_statusr�	getLogger�replace_top_level_logger_name�__name__r_�UAConfig�strr,�verify_json_format_args�assert_root�assert_attached�&_raise_enable_disable_unattached_error�assert_lock_filer�r��r-r+�<module>r�s������
�
�
��L�,�F��g���:��:�:�8�D�E���	����
���2�3�� ��9�	�
���
�>
�!�!�	�������(�I�I�J�����=�)�n�*�K��"�n�b'����'r-

Zerion Mini Shell 1.0