Submit
Path:
~
/
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
/
ec2
/
File Content:
decryptpassword.pyc
� =��Xc @ s� d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z e j e � Z d Z d � Z d e f d � � YZ d S( i����N( t six( t model( t BaseCLIArguments� <p>The file that contains the private key used to launch the instance (e.g. windows-keypair.pem). If this is supplied, the password data sent from EC2 will be decrypted before display.</p>c K s t | | d � | d <d S( s� This handler gets called after the argument table for the operation has been created. It's job is to add the ``priv-launch-key`` parameter. s priv-launch-keyN( t LaunchKeyArgument( t argument_tablet operation_modelt sessiont kwargs( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt ec2_add_priv_launch_key s R c B sk e Z d � Z e d � � Z e d � � Z e j d � � Z e d � � Z d � Z d � Z d � Z RS( c C sM | | _ t j d i d d 6� | _ | | _ | | _ d | _ t | _ d S( NR t stringt type( t _sessionR t Shapet argument_modelt _operation_modelt _namet Nonet _key_patht Falset _required( t selfR R t name( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt __init__- s c C s d S( NR ( ( R ( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt cli_type_name5 s c C s | j S( N( R ( R ( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt required9 s c C s | | _ d S( N( R ( R t value( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyR = s c C s t S( N( t HELP( R ( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt documentationA s c C s# | j | j d | j d d �d S( Nt destt helps SSH Private Key file( t add_argumentt cli_namet py_name( R t parser( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt add_to_parserE s c C s� | r� t j j | � } t j j | � } t j j | � r� | | _ | j j j } d | | j j f } | j j | | j � q� d } t | � � n d S( s This gets called with the value of our ``--priv-launch-key`` if it is specified. It needs to determine if the path provided is valid and, if it is, it stores it in the instance variable ``_key_path`` for use by the decrypt routine. s after-call.%s.%ss_ priv-launch-key should be a path to the local SSH private key file used to launch the instance.N( t ost patht expandvarst expandusert isfileR R t service_modelt endpoint_prefixR R t registert _decrypt_password_datat ValueError( R t parametersR R$ R) t eventt msg( ( sI /tmp/pip-build-uEGWVr/awscli/awscli/customizations/ec2/decryptpassword.pyt add_to_paramsI s c K s | j d k rt j d | j � | j d � } | s; d Sy� t | j � �| } | j � } t j j t j | � � } t j | � } t j | | � } t j | � | j d � | d <t j | � Wd QXWqt k rt j d d t �d } t | � � qXn d S( sq This handler gets called after the GetPasswordData command has been executed. It is called with the and the ``parsed`` data. It checks to see if a private launch key was specified on the command. If it was, it tries to use that private key to decrypt the password data and replace it in the returned data dictionary. s"