CasperSecurity

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

o

��Jhm�@s�ddlZddlmZmZmZmZddlmZmZm	Z	m
Z
mZmZddl
mZddlmZmZe�e�e��Ze��ZGdd�de�ZdS)�N)�Any�Dict�Optional�Tuple)�api�event_logger�
exceptions�messages�system�util)�
UAEntitlement)�ApplicabilityStatus�ApplicationStatusc	s�eZdZdZejZejZej	j
ZejZ
defdd�Zdefdd�Zdejdefdd	�Zdejdefd
d�Zdeeeejffdd
�Zdeeeejff�fdd�Zdeeeejffdd�Z	ddeee fdeee fdedef�fdd�
Z!�Z"S)�LandscapeEntitlement�	landscape�returncC�dS�N����selfrr�A/usr/lib/python3/dist-packages/uaclient/entitlements/landscape.py�enable_steps�z!LandscapeEntitlement.enable_stepscCrrrrrrr�
disable_stepsrz"LandscapeEntitlement.disable_steps�progressc
Cs�dg|j}|��sd|vr|dg7}t�d|�|�t�tjj	d�
|�d���z
tj||��d�Wd
St
jyi}z&t�|�|��s^|�d|j���t
j|j��|j��d��WYd}~d	Sd}~ww)N�landscape-config�--silentz
Executing: %r� ��command)�pipe_stdouterr�info)�stdout�stderrFT)�
extra_args�is_interactive�LOG�debugrr�redact_sensitive_logsr	�EXECUTING_COMMAND�format�joinr
�subpr�ProcessExecutionError�	exception�emitr%�strip�LandscapeConfigFailedr$�rr�cmd�errr�_perform_enables,
��	�
���z$LandscapeEntitlement._perform_enablec
Cs�ddg}|�tjjd�|�d��zt�|�Wn"tjy:}zt	�
|�|�dt|��
��WYd}~nd}~ww|�dtj�dS)Nrz	--disablerr r#T)rr	r+r,r-r
r.rr/r(�errorr1�strr2�LANDSCAPE_CONFIG_REMAINSr4rrr�_perform_disable3s�
 ��z%LandscapeEntitlement._perform_disablecCs(|��rt�d�rtjdfStjtjfS)Nzlandscape-client)�are_required_packages_installedr
�is_systemd_unit_activer�ENABLED�DISABLEDr	�LANDSCAPE_SERVICE_NOT_ACTIVErrrr�application_statusBs��
�z'LandscapeEntitlement.application_statuscsft���}|dtjkr1|jd�di�}|�dd�}t��j}|j	r1|dur1||vr1tjt
jfS|S)Nr�entitlement�affordances�series)�super�applicability_statusr
�INAPPLICABLE�entitlement_cfg�getr
�get_release_inforD�affordance_check_seriesr	�LANDSCAPE_INAPPLICABLE)rrF�
affordance�affordance_series�current_series��	__class__rrrFPs

�
��z)LandscapeEntitlement.applicability_statuscCs@t��rz
t�gd��WdStjydtjfYSwdS)N)rz--is-registeredrT)FN)r�we_are_currently_rootr
r.rr/r	�LANDSCAPE_NOT_REGISTEREDrrrr�enabled_warning_statuses�	���z+LandscapeEntitlement.enabled_warning_statusF�orig_access�deltas�allow_enablecst�j||dd�S)NF)rW)rE�process_contract_deltas)rrUrVrWrPrrrXws�z,LandscapeEntitlement.process_contract_deltas)F)#�__name__�
__module__�__qualname__�namer	�LANDSCAPE_TITLE�title�LANDSCAPE_DESCRIPTION�description�urls�LANDSCAPE_HOME_PAGE�help_doc_url�LANDSCAPE_HELP_TEXT�	help_text�intrrr�ProgressWrapper�boolr7r;rrr�NamedMessagerAr
rFrTrr9rrX�
__classcell__rrrPrrs:
��
��
�
���r)�logging�typingrrrr�uaclientrrrr	r
r�uaclient.entitlements.baser�(uaclient.entitlements.entitlement_statusr
r�	getLogger�replace_top_level_logger_namerYr(�get_event_logger�eventrrrrr�<module>s 
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