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