From e4c3a3969c815e471a5e022dc486345d155f9772 Mon Sep 17 00:00:00 2001 From: Saju Madhavan Date: Wed, 4 Feb 2015 16:47:05 +0530 Subject: [PATCH] implemeted:get subnets by subnet ids we were not able to get the list of subnets based on subnet ids. Added a filter to skip the subnets based on the subnet ids passed --- nova/api/ec2/vpc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/api/ec2/vpc.py b/nova/api/ec2/vpc.py index 3f201b6d2f4..9b26d7fa65b 100644 --- a/nova/api/ec2/vpc.py +++ b/nova/api/ec2/vpc.py @@ -683,6 +683,7 @@ def describe_subnets(self, context, **kwargs): except kc.ClientException as e: raise exception.InvalidRequest(e) + subnet_ids = kwargs.get("subnet_id") # fetch network list vpc_id = self._get_vpcid_from_context(context) neutron = neutronv2.get_client(context) @@ -697,6 +698,9 @@ def describe_subnets(self, context, **kwargs): if not network['name'].startswith('subnet-'): continue + if subnet_ids and network['name'] not in subnet_ids: + continue + if (vpc_id != self._get_vpcid_from_tenantid(network['tenant_id'], context)): continue