Comment 1 for bug 1064235

Revision history for this message
dan wendlandt (danwent) wrote :

Yes, I see this following traceback:

2012-10-09 16:07:35 ERROR [quantum.api.v2.resource] create failed
Traceback (most recent call last):
  File "/opt/stack/quantum/quantum/api/v2/resource.py", line 95, in resource
    result = method(request=request, **args)
  File "/opt/stack/quantum/quantum/api/v2/base.py", line 331, in create
    obj = obj_creator(request.context, **kwargs)
  File "/opt/stack/quantum/quantum/db/l3_db.py", line 154, in create_router
    return self._make_router_dict(router_db)
  File "/opt/stack/quantum/quantum/db/l3_db.py", line 131, in _make_router_dict
    nw_id = router.gw_port['network_id']
TypeError: 'NoneType' object has no attribute '__getitem__'

This has to do with some unexpected behavior from SQLAlchemy in which the "gw_port" relationship on the Router object is not loaded in create_port(), even though the router['gw_port_id'] is populated. Very similar logic for update_port() seems to behave correctly, so this requires more investigation (ideally by someone who understands sqlalchemy relationships well)