File: //lib/python3.6/site-packages/awscli/customizations/codedeploy/__pycache__/uninstall.cpython-36.pyc
3
�T_� � @ sH d dl Z d dlZd dlZd dlmZmZ d dlmZ G dd� de�ZdS )� N)�validate_instance�validate_region)�BasicCommandc @ s, e Zd ZdZdZdd� Zdd� Zdd� Zd S )
� Uninstall� uninstallzBUninstalls the AWS CodeDeploy Agent from the on-premises instance.c C s� |}| j |_t||� t|� |jj� y| j|� | j|� W n> tk
r~ } z"t j
j� t jj
dj|�� W Y d d }~X nX d S )Nz�ERROR
{0}
Uninstall 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_sessionZsessionr r �systemZvalidate_administrator�_uninstall_agent�_delete_config_file� Exception�sys�stdout�flush�stderr�write�format)�selfZparsed_argsZparsed_globals�params�e� r �/usr/lib/python3.6/uninstall.py� _run_main s
zUninstall._run_mainc C s( t jjd� |jj|� t jjd� d S )Nz)Uninstalling the AWS CodeDeploy Agent... zDONE
)r r r r r )r r r r r r 3 s zUninstall._uninstall_agentc C sb t jjd� ytj|jj� W n2 tk
rP } z|jtj kr@|�W Y d d }~X nX t jjd� d S )Nz3Deleting the on-premises instance configuration... zDONE
)
r r r �os�remover ZCONFIG_PATH�OSError�errno�ENOENT)r r r r r r r 8 s zUninstall._delete_config_fileN)�__name__�
__module__�__qualname__�NAMEZDESCRIPTIONr r r r r r r r s
r ) r r r Z&awscli.customizations.codedeploy.utilsr r Zawscli.customizations.commandsr r r r r r �<module> s