Repository: boto/boto

Issue:
boto.vpc.routetable.Route does not contain route origin
RouteSet responses will contain an origin for each route, but boto.vpc.routetable.Route is not populated with the route origin:

Example response before:

```
In [8]: vars(all_route_tables[1].routes[1])
Out[8]:
{'destination_cidr_block': u'0.0.0.0/0',
 'gateway_id': None,
 'instance_id': u'i-123',
 'interface_id': u'eni-123',
 'state': u'active',
 'vpc_peering_connection_id': None}
```

After:

```
In [25]: vars(all_route_tables[1].routes[1])
Out[25]:
{'destination_cidr_block': u'0.0.0.0/0',
 'gateway_id': None,
 'instance_id': u'i-123',
 'interface_id': u'eni-123',
 'origin': u'CreateRoute',
 'state': u'active',
 'vpc_peering_connection_id': None}
```



Discussion:

Resolving patch:
diff --git a/boto/vpc/routetable.py b/boto/vpc/routetable.py
--- a/boto/vpc/routetable.py
+++ b/boto/vpc/routetable.py
@@ -70,6 +70,7 @@ def __init__(self, connection=None):
         self.interface_id = None
         self.vpc_peering_connection_id = None
         self.state = None
+        self.origin = None
 
     def __repr__(self):
         return 'Route:%s' % self.destination_cidr_block
@@ -90,6 +91,8 @@ def endElement(self, name, value, connection):
             self.vpc_peering_connection_id = value
         elif name == 'state':
             self.state = value
+        elif name == 'origin':
+            self.origin = value
 
 class RouteAssociation(object):
     def __init__(self, connection=None):


Test patch:
diff --git a/tests/unit/vpc/test_routetable.py b/tests/unit/vpc/test_routetable.py
--- a/tests/unit/vpc/test_routetable.py
+++ b/tests/unit/vpc/test_routetable.py
@@ -31,7 +31,7 @@ def default_body(self):
                             <main>true</main>
                          </item>
                      </associationSet>
-                    <tagSet/>
+                     <tagSet/>
                   </item>
                   <item>
                      <routeTableId>rtb-f9ad4890</routeTableId>
@@ -47,6 +47,7 @@ def default_body(self):
                            <destinationCidrBlock>0.0.0.0/0</destinationCidrBlock>
                            <gatewayId>igw-eaad4883</gatewayId>
                            <state>active</state>
+                            <origin>CreateRoute</origin>
                         </item>
                         <item>
                             <destinationCidrBlock>10.0.0.0/21</destinationCidrBlock>
@@ -94,6 +95,7 @@ def test_get_all_route_tables(self):
         self.assertEquals(api_response[0].routes[0].destination_cidr_block, '10.0.0.0/22')
         self.assertEquals(api_response[0].routes[0].gateway_id, 'local')
         self.assertEquals(api_response[0].routes[0].state, 'active')
+        self.assertEquals(api_response[0].routes[0].origin, 'CreateRouteTable')
         self.assertEquals(len(api_response[0].associations), 1)
         self.assertEquals(api_response[0].associations[0].id, 'rtbassoc-12ad487b')
         self.assertEquals(api_response[0].associations[0].route_table_id, 'rtb-13ad487a')
@@ -104,15 +106,19 @@ def test_get_all_route_tables(self):
         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[0].origin, 'CreateRouteTable')
         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[1].origin, 'CreateRoute')
         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[2].origin, 'CreateRoute')
         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(api_response[1].routes[3].origin, 'CreateRoute')
         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')