Permalink
Browse files

Merge pull request #2598 from DreadPirateShawn/issue2597

Route Tables: Update describe_route_tables to support additional route types (VPC peering connection, NIC). Fixes #2598, #2597.
  • Loading branch information...
danielgtaylor committed Sep 22, 2014
2 parents fb4aeec + 637b7a5 commit bbe8ce7750d1fa398612b6bfb95a12c5e91ae960
Showing with 25 additions and 1 deletion.
  1. +6 −0 boto/vpc/routetable.py
  2. +19 −1 tests/unit/vpc/test_routetable.py
View
@@ -67,6 +67,8 @@ def __init__(self, connection=None):
self.destination_cidr_block = None
self.gateway_id = None
self.instance_id = None
self.interface_id = None
self.vpc_peering_connection_id = None
self.state = None
def __repr__(self):
@@ -82,6 +84,10 @@ def endElement(self, name, value, connection):
self.gateway_id = value
elif name == 'instanceId':
self.instance_id = value
elif name == 'networkInterfaceId':
self.interface_id = value
elif name == 'vpcPeeringConnectionId':
self.vpc_peering_connection_id = value
elif name == 'state':
self.state = value
@@ -48,6 +48,18 @@ def default_body(self):
<gatewayId>igw-eaad4883</gatewayId>
<state>active</state>
</item>
<item>
<destinationCidrBlock>10.0.0.0/21</destinationCidrBlock>
<networkInterfaceId>eni-884ec1d1</networkInterfaceId>
<state>blackhole</state>
<origin>CreateRoute</origin>
</item>
<item>
<destinationCidrBlock>11.0.0.0/22</destinationCidrBlock>
<vpcPeeringConnectionId>pcx-efc52b86</vpcPeeringConnectionId>
<state>blackhole</state>
<origin>CreateRoute</origin>
</item>
</routeSet>
<associationSet>
<item>
@@ -88,13 +100,19 @@ def test_get_all_route_tables(self):
self.assertIsNone(api_response[0].associations[0].subnet_id)
self.assertEquals(api_response[0].associations[0].main, True)
self.assertEquals(api_response[1].id, 'rtb-f9ad4890')
self.assertEquals(len(api_response[1].routes), 2)
self.assertEquals(len(api_response[1].routes), 4)
self.assertEquals(api_response[1].routes[0].destination_cidr_block, '10.0.0.0/22')
self.assertEquals(api_response[1].routes[0].gateway_id, 'local')
self.assertEquals(api_response[1].routes[0].state, 'active')
self.assertEquals(api_response[1].routes[1].destination_cidr_block, '0.0.0.0/0')
self.assertEquals(api_response[1].routes[1].gateway_id, 'igw-eaad4883')
self.assertEquals(api_response[1].routes[1].state, 'active')
self.assertEquals(api_response[1].routes[2].destination_cidr_block, '10.0.0.0/21')
self.assertEquals(api_response[1].routes[2].interface_id, 'eni-884ec1d1')
self.assertEquals(api_response[1].routes[2].state, 'blackhole')
self.assertEquals(api_response[1].routes[3].destination_cidr_block, '11.0.0.0/22')
self.assertEquals(api_response[1].routes[3].vpc_peering_connection_id, 'pcx-efc52b86')
self.assertEquals(api_response[1].routes[3].state, 'blackhole')
self.assertEquals(len(api_response[1].associations), 1)
self.assertEquals(api_response[1].associations[0].id, 'rtbassoc-faad4893')
self.assertEquals(api_response[1].associations[0].route_table_id, 'rtb-f9ad4890')

0 comments on commit bbe8ce7

Please sign in to comment.