CasperSecurity

Current Path : /lib/python3/dist-packages/uaclient/cli/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/uaclient/cli/__pycache__/detach.cpython-310.pyc

o

��Jh�
�@s&ddlmZmZmZmZmZmZmZmZddl	m
Z
ddlmZm
Z
mZddlmZddlmZddlmZmZddlmZe��Ze
je
je
��e
�d�d	efd
d�����Zdej d
e!de!d	efdd�Z"edej#ej$eej%e
edej&j'dd�dd�edej(j'dd�dddgdd�gd�gd�Z)dS)�)�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�returncKs:t||j|jdkd�}|dkrt��t��t��|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�ret�r!�5/usr/lib/python3/dist-packages/uaclient/cli/detach.py�
action_detachs	�r#rrrc		Cs�g}t�|�D]%}z	tj||d�}Wn
tjyYqw|jdd�\}}|r,|�|�q|rHt�t	j
�t|���|D]}t�d�
|j��q<tj|d�sPdS|D]}t||||dd�qRt�|�}|��t��t|�t�t	j�d	S)
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)	rrr�
to_disable�ent_name�entr �_�machine_token_filer!r!r"r(sD
��
��
r�detachz--assume-yes)�command�
store_true)�help�actionz--format�cli)�default�storer)r>r?�choicesrA)�	arguments)r>�descriptionr?�
help_category�argument_groupsN)*�uaclientrrrrrrrr	�uaclient.clir
�uaclient.cli.commandsrr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_commandr!r!r!r"�<module>sJ(
3�����
�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY