[LIBCLOUD-554] Add support for providing filters and VPC IDs to EC2: ex_list_networks() - #294
[LIBCLOUD-554] Add support for providing filters and VPC IDs to EC2: ex_list_networks()#294zerthimon wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
We still support Python 2.5 which doesn't support second argument (start) to enumerate function so you need to do it like this - https://github.com/zerthimon/libcloud/blob/LIBCLOUD-554_filters/libcloud/compute/drivers/ec2.py#L4307
|
Adding some tests for this new functionality would be good. |
|
Something is wrong with the tests: Providing VPC IDs and filters returns correct number of matching objects when working with EC2 API. In tests the calls return all objects in the fixture (ignores the filter) Please advice! |
|
I went ahead, squashed the commits, fixed the tests and merged changes into trunk. The problem in your case was that you asserted on the response, but you returned the same fixture which contains all the networks. I've changed the tests to assert that the correct query parameters are sent, because that's the thing we are actually interested in and want to test in this case. |
EC2 API allows VPC ID and filters to be provided to list only specific VPCs.
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVpcs.html
Add support for specifying filters and vpc ids when listing networks (vpc's) with ec2 driver's method ex_list_networks()