aws/aws-cli — pull request #195 by garnaat (2013-07-27 19:39:39+00:00)
Title: Adding a --priv-launch-key parameter to get-password-data

This PR adds an additional parameter, ``--priv-launch-key``, to the ``ec2 get-password-data`` operation. This new parameter is modeled after the one in the legacy CLI. If supplied, the value of this parameter should be the path to the local SSH private key (PEM) file that was used when launching the EC2 Windows instance. The private key file will be used to decrypt the password data returned from EC2 to provide the actual password for the EC2 instance.

This PR adds a new dependency. To do the encryption we require a cryptographic module that supports RSA public/private encryption. The ``rsa`` module is a pure Python implementation that seems to work well and doesn't require C compilation on installation like M2Crypto or PyCrypto.

This PR also introduces one additional event that is emitted in ``clidriver.py``. This new event is ``operation-args-parsed``. It is similar to ``top-level-args-parsed``. It is emitted after the command line args are parsed by the OperationArgParser and the ``Namespace`` containing the parsed args is passed to the handler. This was useful in this situation where the additional parameter is not one that needs to be passed on to the operation. It's possible there is another way to accomplish this without adding a new event.