https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/awscli/customizations/codedeploy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/awscli/customizations/codedeploy/__pycache__/systems.cpython-310.pyc
o

.&�a��@snddlZddlZddlZdZGdd�d�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�ZdS)
�Nzcodedeploy.onpremises.ymlc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�SystemzgOnly Ubuntu Server, Red Hat Enterprise Linux Server and Windows Server operating systems are supported.cCs |j|_|jjd|jd�|_dS)N�s3)�region_name)�session�
create_client�regionr��self�params�r�J/usr/lib/python3/dist-packages/awscli/customizations/codedeploy/systems.py�__init__s
�zSystem.__init__cC�td��)N�validate_administrator��NotImplementedError�r	rrrr"�zSystem.validate_administratorcCr)N�installrrrrrr%rzSystem.installcCr)N�	uninstallrrrrrr(rzSystem.uninstallN)�__name__�
__module__�__qualname__�UNSUPPORTED_SYSTEM_MSGr
rrrrrrrrs�rc@sDeZdZdZdZd�ee�ZdZdd�Zdd�Z	d	d
�Z
dd�Zd
S)�Windowsz C:\ProgramData\Amazon\CodeDeployzconf.onpremises.ymlz{0}\{1}zcodedeploy-agent.msicCstjj��s
td��dS)Nz.You must run this command as an Administrator.)�ctypes�windll�shell32�
IsUserAnAdmin�RuntimeErrorrrrrr2s
��zWindows.validate_administratorcCsd|vr|j|_tjgd�tjtjd�}|��\}}d}|jdkr,||vr,td�|���|j	j
|j|jd�}t
|jd��}|�|d	���Wd�n1sPwYtjd
�|j�ddd
gdd�t�gd��tjgd�tjtjd�}|��\}}d|vr�td��dS)N�	installer��powershell.exe�-CommandzStop-Service�-Name�codedeployagent��stdout�stderr�;Cannot find any service with service name 'codedeployagent'r�,Failed to stop the AWS CodeDeploy Agent:
{0}��Bucket�Key�wb�Bodyz.\{0}z/quietz/lz".\codedeploy-agent-install-log.txtT)�shell)r"r#zRestart-Servicer$r%)r"r#zGet-Servicer$r%�Runningz:The AWS CodeDeploy Agent did not start after installation.)r �	INSTALLER�
subprocess�Popen�PIPE�communicate�
returncoder�formatr�
get_object�bucket�key�open�write�read�
check_call)r	r
�process�output�error�	not_found�response�frrrr8sJ�	���
���	��zWindows.installcCsXtjgd�tjtjd�}|��\}}d}|jdkr|��dS||vr*td�|���dS)Nr!r&r)rr*)r3r4r5r6r7�
_remove_agentrr8)r	r
r@rArBrCrrrros�	�
��zWindows.uninstallcCs@tjgd�tjtjd�}|��\}}|jdkrtd�|���dS)N)�wmic�product�wherezname="CodeDeploy Host Agent"�callrz/nointeractiver&rz1Failed to uninstall the AWS CodeDeploy Agent:
{0})r3r4r5r6r7rr8)r	r@rArBrrrrF�s�	
���zWindows._remove_agentN)rrr�
CONFIG_DIR�CONFIG_FILEr8�CONFIG_PATHr2rrrrFrrrrr,s7rc@sTeZdZdZeZd�ee�ZdZdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dd�ZdS)�Linuxz/etc/codedeploy-agent/confz{0}/{1}rcCst��dkr
td��dS)Nrz"You must run this command as sudo.)�os�geteuidrrrrrr�s�zLinux.validate_administratorcCs�d|vr|j|_|�|�|�|�|jj|j|jd�}t|jd��}|�	|d�
��Wd�n1s6wYt�ddd�
|j�g�|j��}tj��}|j|d<|j|d	<|j|d
<|jdurj|j|d<tjd�
|j�dg|d
�dS)Nr r+r.r/�chmodz+xz./{0}�
AWS_REGION�AWS_ACCESS_KEY_ID�AWS_SECRET_ACCESS_KEY�AWS_SESSION_TOKEN�auto)�env)r r2�_update_system�_stop_agentrr9r:r;r<r=r>r3r?r8r�get_credentialsrO�environ�copyr�
access_key�
secret_key�token)r	r
rDrE�credentials�environmentrrrr�s,

��







�z
Linux.installcCs&|�|�}|jdkr|�|�dSdS)Nr)rYr7rF)r	r
r@rrrr�s

�zLinux.uninstallcCr)N�
preinstallrrrrrrX�rzLinux._update_systemcCr)N�remove_agentrrrrrrF�rzLinux._remove_agentcCsJtjgd�tjtjd�}|��\}}|jdkr#|j|vr#td�|���|S)N)�service�codedeploy-agent�stopr&rr*)r3r4r5r6r7�
not_found_msgrr8)r	r
r@rArBrrrrY�s��zLinux._stop_agentN)rrrrK�DEFAULT_CONFIG_FILErLr8rMr2rrrrXrFrYrrrrrN�srNc@�$eZdZdd�Zdd�Zdd�ZdS)�UbuntucCs t�gd��t�gd��dS)N)�apt-get�-y�update)rkrlrzruby2.0�r3r?rrrrrX�szUbuntu._update_systemcC�t�gd��dS)N)�dpkgz-rrernrrrrrF��zUbuntu._remove_agentcC�d|_t�||�S)Nz&codedeploy-agent: unrecognized service�rgrNrYrrrrrY��zUbuntu._stop_agentN�rrrrXrFrYrrrrrj�srjc@ri)�RHELcCro)N)�yumrlr�rubyrnrrrrrX�rqzRHEL._update_systemcCro)N)rwrl�eraserernrrrrrF�rqzRHEL._remove_agentcCrr)Nz<Redirecting to /bin/systemctl stop  codedeploy-agent.servicersrrrrrY�rtzRHEL._stop_agentNrurrrrrv�srv)	rrOr3rhrrrNrjrvrrrr�<module>s
k>

https://t.me/RX1948 - 2025