From 465629902c6b0399251a58776569a8d6a4e590c8 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Thu, 23 Oct 2014 22:36:05 -0400 Subject: [PATCH] use the current ec2 backend, not the default, for subnets --- moto/ec2/responses/subnets.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/moto/ec2/responses/subnets.py b/moto/ec2/responses/subnets.py index 64d34a5d..b7b4af1c 100644 --- a/moto/ec2/responses/subnets.py +++ b/moto/ec2/responses/subnets.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse -from moto.ec2.models import ec2_backend from moto.ec2.utils import filters_from_querystring @@ -10,19 +9,19 @@ class Subnets(BaseResponse): def create_subnet(self): vpc_id = self.querystring.get('VpcId')[0] cidr_block = self.querystring.get('CidrBlock')[0] - subnet = ec2_backend.create_subnet(vpc_id, cidr_block) + subnet = self.ec2_backend.create_subnet(vpc_id, cidr_block) template = Template(CREATE_SUBNET_RESPONSE) return template.render(subnet=subnet) def delete_subnet(self): subnet_id = self.querystring.get('SubnetId')[0] - subnet = ec2_backend.delete_subnet(subnet_id) + subnet = self.ec2_backend.delete_subnet(subnet_id) template = Template(DELETE_SUBNET_RESPONSE) return template.render(subnet=subnet) def describe_subnets(self): filters = filters_from_querystring(self.querystring) - subnets = ec2_backend.get_all_subnets(filters) + subnets = self.ec2_backend.get_all_subnets(filters) template = Template(DESCRIBE_SUBNETS_RESPONSE) return template.render(subnets=subnets)