%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�(�f�
��h�ddlmZmZmZmZmZmZmZmZddl	m
Z
ddlmZm
Z
mZddlmZddlmZddlmZmZddlmZej0�Ze
j4e
j6e
j8�e
j:d�d	efd
�����Zdej@de!d
e!d	efd�Z"edejFejHeejJe
edejLjOd��d��edejPjOd��dddgd��g��g��Z)y)�)�config�daemon�entitlements�event_logger�
exceptions�messages�timer�util)�cli_util)�ProArgument�ProArgumentGroup�
ProCommand)�perform_disable)�HelpCategory)�
machine_token�state_files)�update_motd_messagesz
pro detach�returnc���t||j|jdk(��}|dk(r(tj�tj�tj�|S)zXPerform the detach action for this machine.

    @return: 0 on success, 1 otherwise
    �json)�
assume_yes�json_outputr)	�_detachr�formatr�startr	�stop�event�process_events)�args�cfg�kwargs�rets    �5/usr/lib/python3/dist-packages/uaclient/cli/detach.py�
action_detachr$sN�������d�k�k�V�6K��C��a�x�����
�
�
��	�����J�r rrc��g}tj|�D]C}	tj||��}|jd��\}}|s�3|j
|��E|rptjtjjt|���|D]0}tjdj|j���2tj |��sy|D]}t#||||d���t%j&|�}|j)�t+j,�t/|�tjtj0�y	#tj$rY��dwxYw)
ajDetach the machine from the active Ubuntu Pro subscription,

    :param cfg: a ``config.UAConfig`` instance
    :param assume_yes: Assume a yes answer to any prompts requested.
         In this case, it means automatically disable any service during
         detach.
    :param json_output: output should be json only

    @return: 0 on success, 1 otherwise
    )r �nameT)�ignore_dependent_servicesz    {})r�F)rr�
update_statusr)r�entitlements_disable_order�entitlement_factoryr�EntitlementNotFoundError�can_disable�appendr�infor�DETACH_WILL_DISABLE�	pluralize�lenrr'r
�prompt_for_confirmationrr�get_machine_token_file�deleter�delete_state_filesr�DETACH_SUCCESS)	r rr�
to_disable�ent_name�entr"�_�machine_token_files	         r#rr(sL���J� �;�;�C�@�#��	��2�2����C����4��@���Q�����c�"�#� �
�
�
�8�/�/�9�9�#�j�/�J�K��	2�C��J�J�x���s�x�x�0�1�	2��'�'�:�>���
�����#�!��	
�
�'�=�=�c�B�������"�"�$����	�J�J�x�&�&�'���=�2�2�	��	�s�E&�&E=�<E=�detachz--assume-yes)�command�
store_true)�help�actionz--format�cli)�default�storer)rArB�choicesrD)�	arguments)rA�descriptionrB�
help_category�argument_groupsN)*�uaclientrrrrrrr	r
�uaclient.clir�uaclient.cli.commandsrr
r�uaclient.cli.disabler�uaclient.cli.parserr�uaclient.filesrr�uaclient.timer.update_messagingr�get_event_loggerr�verify_json_format_args�assert_root�assert_attached�assert_lock_file�intr$�UAConfig�boolr�CLI_ROOT_DETACH�CLI_DETACH_DESC�OTHER�CLI_ASSUME_YESr�CLI_FORMAT_DESC�detach_command�r%r#�<module>rasM��	�	�	�"�K�K�0�,�5�@�%��%�%�'��
�!�!�	������������<�(��S��)���"��0
����0
�d�0
��0
�#�0
�f��	�	!�	!��(�(���$�$���"�!�0�0�7�7��7�I�'��
��!�1�1�8�8��8�G�"�"�F�O�!��

�	
��
�r%

Zerion Mini Shell 1.0