Merge lp://staging/~sinzui/juju-ci-tools/aws-client into lp://staging/juju-ci-tools

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 1769
Proposed branch: lp://staging/~sinzui/juju-ci-tools/aws-client
Merge into: lp://staging/juju-ci-tools
Diff against target: 403 lines (+394/-0)
2 files modified
aws.py (+193/-0)
tests/test_aws.py (+201/-0)
To merge this branch: bzr merge lp://staging/~sinzui/juju-ci-tools/aws-client
Reviewer Review Type Date Requested Status
Seman (community) Approve
Review via email: mp+311970@code.staging.launchpad.net

Description of the change

Add AWS client to list and delete instances

This branch add aws.py that can list and delete instances in an EC2 region. This script is based on gce.py. I Thought I could import many of the functions from gce.py, but the libcloud EC2 client is different enough to require separate implementations for all the functions. /o\.

AWS, unlike GCE, has a created_at property with a real date. EC2 has key-value pairs as tags, where as gce (and rackspace) have a list of names. We can only query a single region
in EC2, so I added a region arg. I cannot find the exact zone the instance is deployed too.

To post a comment you must log in.
1770. By Curtis Hovey

Fixed doc.

Revision history for this message
Seman (sseman) wrote :

Thank you for adding this cleanup code.

Please see inline comment

review: Needs Fixing
1771. By Curtis Hovey

make region a positional arg.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I made region a positional arg. It is not required for a subcommand because it belongs to the client, not the operation.

source ./cloud-city/ec2rc
./juju-ci-tools/aws.py -v eu-west-1 list-instances

Revision history for this message
Seman (sseman) wrote :

Thanks.

I would probably make --old-age option for both subcommands: list-instances and delete-instances.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches