Check for VPN Objects when deleting interfaces

When we delete Router interfaces/gateway,
we need to check if any VPN services are
associated with that router.

Closes-Bug:1261598

Change-Id: I7df2b8b130b47ec070d0b0a36b1a62df40532760
mock.assert_called_once() is not a valid method

mock.assert_called_once() is a no-op that tests nothing. Instead
mock.assert_called_once_with() should be used (or use
assertEqual(1, mock_obj.call_count) if you don't want to check
parameters).

Borrowed HACKING rule from Davanum Srinivas's nova patch to
prevent it from appearing again.

Change-Id: Idac1d3c89c07e13c9a209663f4e557fcb7547821
Closes-Bug: #1365751
Closes-Bug: #1300265
Cisco N1kv: Fix update network profile for add tenants

This patch makes sure that while updating network profile to add new
tenants, it does not delete the older profile bindings and maintains
them, while adds only the new tenant ids to the bindings.

Change-Id: I862eb1c400e022334a2f6a4078425448bb144843
Closes-bug: #1379609
Improve performance of security group DB query

The _select_ips_for_remote_group method was joining the
IP allocation, port, allowed address pair, and security group tables
together in a single query. Additionally, it was loading all of
the port columns and using none of them. This resulted in a
very expensive query with no benefit.

This patch eliminates the unnecessary use of the port table by joining
the IP allocation table directly to the security groups and allowed
address pairs tables. In local testing of the method, this sped it up
by an order of magnitude.

Closes-Bug: #1373851
Change-Id: I12899413004838d2d22b691f1e2f3b18f7ec2c27
Remove redundant initialization and check from DVR RPC mixin

The initialization, as well as the recurrent checks on whether the agent
is able to handle DVR requests, are not necessary; this is because the
dvr_agent is going to be set at the time the L2 agent starts receiving
RPC messages.

Change-Id: I9caad965d0ff507e2ed93d6432997ad86139ac04
Modify docstring on send_delete_port_request in N1kv plugin

N1kv plugin: Modify docstring on _send_delete_port_request method

Change-Id: I64d34878ffd8f6db703e4c1d9849032fef9bae96
Closes-Bug: #1381277
Moves the HA resource creations outside of transaction

Currently the HA resources are created in the
_create_router_db which includes calls to
the plugin and generates RPC calls. Even if the
resource creations are outside of any transaction
from the _create_router_db point of view, this
method is  called in a transaction from the
create_router method.
This patch moves the resource creations to the
create_router method outside the transaction.
The failures are handled as previously with
a try/expect.

Change-Id: If8fcfd012f8e992175e49bbefb2ae667881a620a
Closes-bug: #1374461
Fix race condition on processing DVR floating IPs

Fip namespace and agent gateway port can be shared by multiple dvr routers.
This change uses a set as the control variable for these shared resources
and ensures that Test and Set operation on the control variable are
performed atomically so that race conditions do not occur among
multiple threads processing floating IPs.
Limitation: The scope of this change is limited to addressing the race
condition described in the bug report. It may not address other issues
such as pre-existing issue with handling of DVR floatingips on agent
restart.

closes-bug: #1381238

Change-Id: I6dc2b7bad6e8ddbaa86c1f7a1e2028aeacc3afef
Updated from global requirements

Change-Id: Idcbd730f5c781d21ea75e7bfb15959c8f517980f
Merge "mock.assert_called_once() is not a valid method"
Merge "Modify docstring on send_delete_port_request in N1kv plugin"
Merge "Check for VPN Objects when deleting interfaces"
Merge "Updated from global requirements"
Merge "Moves the HA resource creations outside of transaction"
Merge "Cisco N1kv: Fix update network profile for add tenants"
Merge "Improve performance of security group DB query"
Merge "Remove redundant initialization and check from DVR RPC mixin"
Merge "Fix race condition on processing DVR floating IPs"
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I58db0476c810aa901463b07c42182eef0adb5114