plugins/ryu/db/api: fix exception

This patch fixes the following exception.

2012-04-06 14:42:50 DEBUG nova.network.quantum.quantum_connection [req-fe4ad405-54cb-46da-b2c6-5164e47a91fc None None] Quantum Client Reply (code = 500) :
 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/quantum/quantum/wsgi.py", line 748, in __call__
    action_result = self.dispatch(request, action, args)
  File "/opt/stack/quantum/quantum/wsgi.py", line 780, in dispatch
    return controller_method(request=request, **action_args)
  File "/opt/stack/quantum/quantum/api/api_common.py", line 108, in the_func
    return func(*args, **kwargs)
  File "/opt/stack/quantum/quantum/api/networks.py", line 134, in create
    **body)
  File "/opt/stack/quantum/quantum/plugins/ryu/ovs_quantum_plugin_base.py", line 104, in create_network
    self.driver.create_network(net)
  File "/opt/stack/quantum/quantum/plugins/ryu/ryu_quantum_plugin.py", line 76, in create_network
    tunnel_key = ryu_db.tunnel_key_allocate(net.uuid)
  File "/opt/stack/quantum/quantum/plugins/ryu/db/api.py", line 171, in tunnel_key_allocate
    last_key = _tunnel_key_last(session)
  File "/opt/stack/quantum/quantum/plugins/ryu/db/api.py", line 120, in _tunnel_key_last
    session.query(models.TunnelKeyLast).all().delete()
AttributeError: 'list' object has no attribute 'delete'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
plugins/ryu/nova/linux_net: typo. s/tenant_id/net_tenant_id/g

This patch fixes the following exception.

TRACE nova.rpc.amqp Traceback (most recent call last):
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/rpc/amqp.py", line 252, in _process_data
TRACE nova.rpc.amqp     rval = node_func(context=ctxt, **node_args)
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/network/quantum/manager.py", line 366, in allocate_for_instance
TRACE nova.rpc.amqp     vif_rec, network['net_tenant_id'])
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/utils.py", line 947, in inner
TRACE nova.rpc.amqp     retval = f(*args, **kwargs)
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/network/quantum/manager.py", line 472, in enable_dhcp
TRACE nova.rpc.amqp     self.l3driver.initialize_gateway(network_ref)
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/network/l3.py", line 98, in initialize_gateway
TRACE nova.rpc.amqp     gateway=(network_ref['gateway'] is not None))
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/network/linux_net.py", line 898, in plug
TRACE nova.rpc.amqp     return _get_interface_driver().plug(network, mac_address, gateway)
TRACE nova.rpc.amqp   File "/opt/stack/quantum/quantum/plugins/ryu/nova/linux_net.py", line 77, in plug
TRACE nova.rpc.amqp     self._set_port_state(network, dev, body)
TRACE nova.rpc.amqp   File "/opt/stack/quantum/quantum/plugins/ryu/nova/linux_net.py", line 57, in _set_port_state
TRACE nova.rpc.amqp     tenant_id = network['tenant_id']
TRACE nova.rpc.amqp   File "/opt/stack/nova/nova/db/sqlalchemy/models.py", line 75, in __getitem__
TRACE nova.rpc.amqp     return getattr(self, key)
TRACE nova.rpc.amqp AttributeError: 'Network' object has no attribute 'tenant_id'
TRACE nova.rpc.amqp

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>