Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/uaclient/cli/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/uaclient/cli/__pycache__/disable.cpython-310.pyc
o

���f1$�@sddlZddlZddlZddlmZmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZddlmZmZddlmZe�e�e��Zdejd	ed
eedeeded
efdd�Z ej!ej"e�#ej$�e�%d�dd�����Z&dejfdd�Z'dS)�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Cs�g}|D]}|j|ks|j|vrq|jD]
}|j|kr!|�|j�qq|D]}	t�||	�}
tjj||
d�}tj	|d�sBt
j||
d��q%dS)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_msg�r)�6/usr/lib/python3/dist-packages/uaclient/cli/disable.py�prompt_for_dependency_handlings0

�������r+zpro disablecKsjg}g}g}g}tjddd�}|jdk}|j}	t�|�}
|jr(|	r(tjddd��t	|dg�}t
�||�\}}
d	d
�t|�j
D�}t|�j}d}|D]�}t
j|||jd�}|j}|d
ur]|}|	s�zt||j||||jd�Wn)tjy�}zt�|�|
|j�|
tjj|jd��d}WYd
}~qId
}~ww|r�t��}n	t�tj|	d��}|��|_zT|� |�\}}t!j!|d�|s�d}|�"|�|d
ur�t#|t$�r�|j%d
ur�|
|j%j�|�"d|j|j%j|j%jd��n|�"|�|�&�}|r�d|d<|
tj'jdd��WqItj�y9}z+d}|�"|�|
|j�|
tj(j|jd��|�"d|j|j|j)|j*d��WYd
}~qId
}~ww|
�rvd}dd�+t
j,|d��d}d�+t-j.|dddd��}tj/dd�+|
�|d�}|
|j�|�"dd
|j|j)|j*d��t0�1|�}|�2�|�r�|�3�|�3�|�r�dnd |d!<||d"<||d#<||d$<||d%<t4t5j6|t7j8dd&��|�r�d'Sd(S))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�option2rcSsg|]}|j�qSr))r)�.0r%r)r)r*�
<listcomp>cs�z"action_disable.<locals>.<listcomp>T)rr�purgeN)rr)�title)�
assume_yes�r)�typer�message�message_coder/zdisable operation)�	operation)r;rr<r=�additional_infozTry �, �.�
�P)�width�break_long_words�break_on_hyphens�disable)r>�invalid_service�service_msg�system�failurer.�processed_services�failed_services�errors�warnings)�cls�	sort_keysr�)9r�JSON_SCHEMA_VERSIONr!r9r�&create_interactive_only_print_functionr7r	�InvalidOptionCombination�getattrr�get_valid_entitlement_namesr�enabled_servicesr�services�entitlement_factory�enabled_variantr+rr8�UbuntuProError�LOG�	exceptionrr
�
ENABLE_FAILEDr�ProgressWrapper�CLIEnableDisableProgress�calculate_total_disable_steps�total_stepsrGrr�
isinstancerr<�_check_for_reboot�ENABLE_REBOOT_REQUIRED_TMPL�DISABLE_FAILED_TMPL�msg_coder?�join�valid_services�textwrap�wrap�InvalidServiceOpErrorr�UAContractClient�update_activity_token�sort�printr0�dumpsr�DatetimeAwareJSONEncoder)�argsr�kwargsrLrMrNrO�
json_response�json_outputr9�interactive_only_print�names�entitlements_found�entitlements_not_foundrr�ret�ent_name�ent�variant�e�progress�disable_ret�reason�ent_reboot_required�valid_namesrI�err�contract_clientr)r)r*�action_disable;s0	�
�
�
��
�
�

���	

�


�
���
	���

���������
��

��r�c
Cs�|jdtjd�}|jtd�tjjtjdd�}tj	|_
||_d|_tj
|j_tj|j_|jdddtjjd	�tj|d
��d�d�|jd
dtjjdd�d�|jddddgdtjjdd�d�|jddtjd�|S)z5Build or extend an arg parser for disable subcommand.rG)�help)�actionzdisable <service> [<service>])r�commandr�store�+r@r:)�options)r��nargsr�r2�
store_true)r�)r�r�z--format�clir0)�default)r��choicesr�r�r1)�
add_parserr
�CLI_ROOT_DISABLE�set_defaultsr�r�
USAGE_TMPLr!�NAME�CLI_DISABLE_DESC�description�usage�prog�CLI_ARGS�_positionalsr8�	CLI_FLAGS�
_optionals�add_argument�CLI_DISABLE_SERVICErirrj�CLI_ASSUME_YES�CLI_FORMAT_DESC�	CLI_PURGE)�
subparsersr�parserr�r)r)r*r��sH�

��
���r�)(r0�loggingrk�typingrr�uaclientrrrrrr	r
rr�+uaclient.api.u.pro.services.dependencies.v1r
r�-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)r)r*�<module>s<,�����
�
6

Spamworldpro Mini