Optimize get_instance_nw_info and remove ipam

The get network info was making 4 * num_networks + 1 rpc and db
queries. The network info is recalculated quite often, so we use
the new joins to turn this into a single query. In the process we
remove nova_ipam_lib which was initially created as part of a very
old neutron proxy and only added an unnecessary layer of abstraction.

Change-Id: I34ca575fb33b43ab8780357990b73df837da71c2
Closes-Bug: #1365606
Fix unit test failure due to tests sharing mocks

A recent refactor made test_get_port_vnic_info 2 and 3 share code
in a private method _test_get_port_vnic_info(). A mock on this method
is shared between the tests and can cause the following failure:

AssertionError: Expected to be called once. Called 2 times.

This is changed so that the two test methods create separate mocks and
pass to the shared method.

Change-Id: I3902b7b7cf4b4b3fdc2885bf2611a712d008c617
Closes-Bug: #1381414
Merge "Fix unit test failure due to tests sharing mocks"
Handle Forbidden error from network_api.show_port in os-interface:show

We can get a 403 back from the neutronv2 API when calling
network_api.show_port so handle that in the compute API extension.

This also updates the v3 API code to match the v2 API code to put the
original error message for the 404 into the HTTPNotFound error.

Closes-Bug: #1378389

Change-Id: I7afc832f26481dc44f1c500b6121e2060f36c63a
Fix genconfig - missed one import from oslo cleanup

The oslo cleanup Ib020cd4c3464f1c994a6d77f4b894f41b99e6d02 removed
importutils, we forgot to fix the generator.py

Change-Id: Ib353f7e0fee5f7ed06f4b45f98fb1a1bf6abfc9e
Port os-tenant-networks plugin to v2.1(v3) infrastructure

Ports os-tenant-networks extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical.

- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I340c9b1312a3477c63d28f19df9611c95e67cde6
Port os-networks-associate plugin to v2.1(v3) infrastructure

Ports os-networks-associate extension and adapts it to the
v2.1/v3 API framework. API behaviour is identical.

- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I6ccf9613abf999784c548fb058522ac60db7f052
Merge "Optimize get_instance_nw_info and remove ipam"
Merge "Port os-tenant-networks plugin to v2.1(v3) infrastructure"
Merge "Port os-networks-associate plugin to v2.1(v3) infrastructure"
Merge "Handle Forbidden error from network_api.show_port in os-interface:show"
Merge "Fix genconfig - missed one import from oslo cleanup"