HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/codedeploy/__pycache__/install.cpython-36.pyc
3

�T_m�@sTddlZddlZddlZddlZddlmZddlmZmZm	Z	Gdd�de�Z
dS)�N)�BasicCommand)�validate_region�validate_s3_location�validate_instancec@sdeZdZdZdZddddd�dd	d
dd�d
dd
dd�gZdd�Zdd�Zdd�Zdd�Z	dd�Z
dS)�Install�installzMConfigures and installs the AWS CodeDeploy Agent on the on-premises instance.zconfig-filez--config-file <path>TzBRequired. The path to the on-premises instance configuration file.)�nameZsynopsisZrequired�	help_textzoverride-config�
store_trueFz@Optional. Overrides the on-premises instance configuration file.)r�action�defaultr	zagent-installerz--agent-installer <s3-location>z2Optional. The AWS CodeDeploy Agent installer file.cCs�|}|j|_t||�t|�|jj�|j|�|j|�y|j|�|j	|�Wn>t
k
r�}z"tjj
�tjjdj|��WYdd}~XnXdS)Nz�ERROR
{0}
Install the AWS CodeDeploy Agent on the on-premises instance by following the instructions in "Configure Existing On-Premises Instances by Using AWS CodeDeploy" in the AWS CodeDeploy User Guide.
)Z_sessionZsessionrr�systemZvalidate_administrator�_validate_override_config�_validate_agent_installer�_create_config�_install_agent�	Exception�sys�stdout�flush�stderr�write�format)�selfZparsed_argsZparsed_globals�params�e�r�/usr/lib/python3.6/install.py�	_run_main=s





zInstall._run_maincCs$tjj|jj�r |jr td��dS)Nz�The on-premises instance configuration file already exists. Specify --override-config to update the existing on-premises instance configuration file.)�os�path�isfiler
�CONFIG_PATHZoverride_config�RuntimeError)rrrrrrTsz!Install._validate_override_configcCsht|d�d|kr dj|j�|_d|krDdj|jj�|_|jj|_n |jjd�d}|j|d�|_dS)NZagent_installer�bucketzaws-codedeploy-{0}�keyz
latest/{0}�/�)	rrZregionr$r
Z	INSTALLERr%Z	installer�rfind)rr�startrrrr]s
z!Install._validate_agent_installercCs�tjjd�ytj|jj�Wn2tk
rP}z|jtj	kr@|�WYdd}~XnX|j
|jjkrrtj
|j
|jj�tjjd�dS)Nz8Creating the on-premises instance configuration file... zDONE
)rrrr�makedirsr
Z
CONFIG_DIR�OSError�errnoZEEXISTZconfig_filer"�shutilZcopyfile)rrrrrrrhszInstall._create_configcCs(tjjd�|jj|�tjjd�dS)Nz'Installing the AWS CodeDeploy Agent... zDONE
)rrrr
r)rrrrrruszInstall._install_agentN)�__name__�
__module__�__qualname__�NAMEZDESCRIPTIONZ	ARG_TABLErrrrrrrrrrs&
	
r)r,rr-rZawscli.customizations.commandsrZ&awscli.customizations.codedeploy.utilsrrrrrrrr�<module>s