Delete subnet fails if assoc port has IPs from another subnet

This change fixes the following failure scenario:
- Create a network
- Create two subnets on the network
- Create a port on the network using one of the subnets
- Delete the other subnet
= = = > FAILURE: Subnet delete fails because supposedly there
is/are port(s) still associated with that subnet.

The problem addressed is that delete_subnet() in
neutron/db/db_base_plugin.py is checking for port(s) still being
associated with the subnet's network, not the subnet itself.

Change-Id: I7adbe18cce412135b2e42dcb7c592e60c1ec5f8f
Closes-Bug: #1281694
Fix segment allocation tables in Cisco N1kv plugin

The segment allocation table is emptied on deleting any network profile.
This change allows the use of segment range from the network profile table.
By using the network profile UUID as a foreign key in the segment allocations table,
tables are cleaned up only for the segments associated with
the deleted network profile via CASCADE, leaving no inconsistencies.

Change-Id: I507041fac3768a7b688ddcf28c4d97c618bfe3f9
Closes-Bug: #1288407
Synced rpc and gettextutils modules from oslo-incubator

The main reason for sync is to get the following oslo-rpc fixes in Neutron:
* I537015f452eb770acba41fdedfe221628f52a920 (reduces delays when reconnecting
  to Qpid in HA deployments)
* Ia148baa6e1ec632789ac3621c85173c2c16f3918 (fixed HA failover, Qpid part)
* I67923cb024bbd143edc8edccf35b9b400df31eb3 (fixed HA failover, RabbitMQ part)

Latest oslo-incubator commit at the moment of sync:
* 2eab986ef3c43f8d1e25065e3cbc1307860c25c7

Change-Id: I2f5bb0d195e050f755ecdbf06a6bbed587a04fbe
Closes-Bug: 1281148
Closes-Bug: 1261631
Disable XML tests on Py26

Unit testing on Py26 takes too long to run.  The code paths are the
same, so we'll temporarily skip tests is the class contains XML
formating since duplicate full stack JSON tests are run.

Change-Id: Ie8eddfe0b6af39f32380ce532e0c26acc0a6596d
Related-Bug: 1295281
Fix namespace exist() method

Fix namespace exist() method for it shall not be called with a root.
Also, don't run it under the namespace so garbage_collect_namespace
method can run without rootwrap and not withi a ns.

As a result of fixing namespace listing the patch also fixes the
regression introduced (bug/1294603) to loadbalancer agent respawning
haproxy due to inability to list namespaces properly.

Change-Id: I0dc4d01b0c1c04887ec6ad5766ec7c6c96903faa
Closes-Bug: #1297594
Closes-Bug: #1294603
UT: do not hide an original error in test resource ctxtmgr

In unit tests, resource contextmanagers such as network(), subnet()
try to delete themselves after returning from yield even if an
exception occurs. However when an exception occurs, there is a case
where deletion fails. In this case original exception will be hidden
and it makes difficult to debug test failures.

Before each test starts, resources like database entries will be
recreated, so there is no need to try to delete resources even
when an exception occurs. This commit removes try-finally clause
from resource contextmanagers to make original errors visible.

Closes-Bug: #1295887
Change-Id: Ia844d2aa2c9fc036e643068c5284f64798963ee3
Delete duplicate external devices in router namespace

When a router's gateway is removed during L3-agent restart, the agent
will fail to delete the old external device.  This device should be
identified and removed as soon as possible.

Change-Id: Ifd3e6ca009242138bea4a098e3fde258aeaa391e
Closes-Bug: #1298658
Cancelling thread start while unit tests running

This change modifies the Radware driver and its unit testing code
to not start operations completion thread while unit tests are running.

The driver initialization changed not to start the operations completion thread,
the thread is started only when operation completion item is inserted into the queue
for the first time.
The operation completion functionality was moved to a new function which
is called by the operations completion thread run() function.
The run() function still have the functionality of popping operation completion
items out of the queue and push failed items back.

Unit testing code mocks the operation completion items queue
by calling the operations completion hanler new function when item
is added.

Start() and join() functions of the thread were mocked to do nothing.

All sleep() entrances were removed from the unit testing code.
All unnecessary mock_reset() calls were removed.

Change-Id: I72380bf223be690831aba1fc29c3dca910245516
Closes-Bug: #1245208
Merge "Fix segment allocation tables in Cisco N1kv plugin"
Add missing parameters for port creation

Recent API changes in N1KV controller require parameters such as
subnet id and IP address to handle port creation successfully.
Without these mandatory paramters, the REST call fails.
This patch addresses that by passing in the missing parameters
in the REST body.

Change-Id: I4cec6868051f492b9d1245ab201ff6c1a0837848
Closes-Bug: #1290561
Merge "Fix namespace exist() method"
Merge "Disable XML tests on Py26"
Invoke _process_l3_create within plugin session

_process_l3_create should be invoked with a plugin session, else
externalnetworks table is not populated for networks with
router:external=True. Added the missing plugin session.

Change-Id: I09c49dea9474f91a70aef829c1596fbb9089d6cf
Closes-Bug: #1299946
Merge "UT: do not hide an original error in test resource ctxtmgr"
Imported Translations from Transifex

Change-Id: I3039f6c62ac35200b47f9e73760f9ef33dd5efee
Merge "Add missing parameters for port creation"
Merge "Delete subnet fails if assoc port has IPs from another subnet"
Add Icehouse no-op migration

This migration marks the database migration timeline milestone for
Icehouse.

Change-Id: I8be0322843e506c07e83dc4ba1c135f36a6e2505
Merge "Imported Translations from Transifex"
Merge "Delete duplicate external devices in router namespace"