vmware-nsx/neutron/api/rpc
Numan Siddique 58e0b8bafb Fix KeyError in dhcp_rpc when plugin.port_update raise exception
KeyError exception is seen because of following reasons

* DhcpRpcCallback._port_action() is called by two functions
   -  DhcpRpcCallback.create_dchp_port()
   -  DhcpRpcCallback.update_dhcp_port()

* When create_dhcp_port() function calls _port_action(), the
  function argument 'port' will have the body as
  {'port': {'network_id': foo_network_id, 'fixed_ips': [..] ...}

* When update_dhcp_port() function calls _port_action(), the
  function argument 'port' will have the body as
  {'id': port_id, 'port': {{'port': {'network_id': foo_network_id,
			            'fixed_ips': [..] ...}}

* If an exception occurs when _port_action() calls plugin.create_port(),
  network id is accessed as
  net_id = port['port']['network_id']

* If an exception occurs when _port_action() calls plugin.update_port(),
  network id is accessed as
  net_id = port['port']['network_id']
  which is causing the KeyError. network_id should have been accessed as
  net_id = port['port']['port']['network_id']

This patch fixes the issue by making the _port_action() take the
same port body. update_dhcp_port() insteading of passing the port_id
and port information in a single argument, it now adds port_id
in the port body itself.

Change-Id: I70b92fa20b421b05ca2053a9a57f62db726f7625
Closes-bug: #1378508
2014-10-15 13:14:40 +05:30
..
agentnotifiers Merge "HA routers master state now distributed amongst agents" 2014-09-20 05:48:39 +00:00
handlers Fix KeyError in dhcp_rpc when plugin.port_update raise exception 2014-10-15 13:14:40 +05:30
__init__.py Remove invalid copyright headers under API module 2014-04-02 11:09:03 -07:00