Change subnets to only have a reference to the vpc_id.
This commit is contained in:
parent
1c10d887c0
commit
815bb8846c
@ -682,9 +682,9 @@ class VPCBackend(object):
|
||||
|
||||
|
||||
class Subnet(object):
|
||||
def __init__(self, subnet_id, vpc, cidr_block):
|
||||
def __init__(self, subnet_id, vpc_id, cidr_block):
|
||||
self.id = subnet_id
|
||||
self.vpc = vpc
|
||||
self.vpc_id = vpc_id
|
||||
self.cidr_block = cidr_block
|
||||
|
||||
@classmethod
|
||||
@ -710,8 +710,7 @@ class SubnetBackend(object):
|
||||
|
||||
def create_subnet(self, vpc_id, cidr_block):
|
||||
subnet_id = random_subnet_id()
|
||||
vpc = self.get_vpc(vpc_id)
|
||||
subnet = Subnet(subnet_id, vpc, cidr_block)
|
||||
subnet = Subnet(subnet_id, vpc_id, cidr_block)
|
||||
self.subnets[subnet_id] = subnet
|
||||
return subnet
|
||||
|
||||
|
@ -33,7 +33,7 @@ CREATE_SUBNET_RESPONSE = """
|
||||
<subnet>
|
||||
<subnetId>{{ subnet.id }}</subnetId>
|
||||
<state>pending</state>
|
||||
<vpcId>{{ subnet.vpc.id }}</vpcId>
|
||||
<vpcId>{{ subnet.vpc_id }}</vpcId>
|
||||
<cidrBlock>{{ subnet.cidr_block }}</cidrBlock>
|
||||
<availableIpAddressCount>251</availableIpAddressCount>
|
||||
<availabilityZone>us-east-1a</availabilityZone>
|
||||
@ -55,7 +55,7 @@ DESCRIBE_SUBNETS_RESPONSE = """
|
||||
<item>
|
||||
<subnetId>{{ subnet.id }}</subnetId>
|
||||
<state>available</state>
|
||||
<vpcId>{{ subnet.vpc.id }}</vpcId>
|
||||
<vpcId>{{ subnet.vpc_id }}</vpcId>
|
||||
<cidrBlock>{{ subnet.cidr_block }}</cidrBlock>
|
||||
<availableIpAddressCount>251</availableIpAddressCount>
|
||||
<availabilityZone>us-east-1a</availabilityZone>
|
||||
|
Loading…
Reference in New Issue
Block a user