Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
/
codedeploy
/
File Content:
deregister.pyc
� =��Xc @ sb d d l Z d d l m Z d d l m Z d d l m Z m Z m Z d e f d � � YZ d S( i����N( t ClientError( t BasicCommand( t validate_regiont validate_instance_namet INSTANCE_NAME_ARGt Deregisterc B s{ e Z d Z d Z e i d d 6d d 6e d 6d d 6g Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( t deregisters� Removes any tags from the on-premises instance; deregisters the on-premises instance from AWS CodeDeploy; and, unless requested otherwise, deletes the IAM user for the on-premises instance.s no-delete-iam-usert namet store_truet actiont defaultsM Optional. Do not delete the IAM user for the registered on-premises instance.t help_textc C s1 | } | j | _ t | | � t | � | j j d d | j d | j d | j �| _ | j j d d | j �| _ yz | j | � | j r� | j | � n | j | � | j s� | j | � | j | � | j | � n t j j d � Wn9 t k r,} t j j � t j j d j | � � n Xd S( Nt codedeployt region_namet endpoint_urlt verifyt iamsn Run the following command on the on-premises instance to uninstall the codedeploy-agent: aws deploy uninstall s� ERROR {0} Deregister the on-premises instance by following the instructions in "Configure Existing On-Premises Instances by Using AWS CodeDeploy" in the AWS CodeDeploy User Guide. ( t _sessiont sessionR R t create_clientt regionR t verify_sslR R t _get_instance_infot tagst _remove_tagst _deregister_instancet no_delete_iam_usert _delete_user_policyt _delete_access_keyt _delete_iam_usert syst stdoutt writet Exceptiont flusht stderrt format( t selft parsed_argst parsed_globalst paramst e( ( sK /tmp/pip-build-uEGWVr/awscli/awscli/customizations/codedeploy/deregister.pyt _run_main- s8 c C s� t j j d � | j j d | j � } | d d | _ | j j d � d } | j | | _ | d d | _ t j j d j | j � � | j r� t j j d � x5 | j D]* } t j j d j | d | d � � q� Wt j j d � n d S( Ns/ Retrieving on-premises instance information... t instanceNamet instanceInfot iamUserArnt /i R s DONE IamUserArn: {0} s Tags:s Key={0},Value={1}t Keyt Values ( R R R R t get_on_premises_instancet instance_namet iam_user_arnt rfindt user_nameR R$ ( R% R( t responset startt tag( ( sK /tmp/pip-build-uEGWVr/awscli/awscli/customizations/codedeploy/deregister.pyR W s c C sF t j j d � | j j d | j d | j g � t j j d � d S( Ns/ Removing tags from the on-premises instance... R t instanceNamess DONE ( R R R R t&