LBaaS: fix handling pending create/update members and health monitors

When agent requests loadbalancer logical config from server,
server returns only active pool members and health_monitors.
Need to make server return also members and monitors which are in pending states.

Also a small refactoring moving ACTIVE_PENDING set to common place

Change-Id: I8e10004f199f982b055da18ea7a0e5e4d11fa7fb
Closes-Bug: #1259965
[ML2] l2-pop MD handle multi create/delete ports

If more than one port is added or removed simultaneously, port db entry
have status BUILD or DOWN and pass to ACTIVE when agent have finish to
configured it.
l2-pop mechanism driver use events port pass to ACTIVE or DOWN to send
fdb entries. In case of port is the first or the last network port on
an agent, the flooding entry need to be add or removed.

This patch fix the method to determine how many ports are active on a
agent by adding filter on status port to be ACTIVE.

Closes-bug: #1263881
Change-Id: I9c1f8bd69dee37bc01a5d42327aa5f737998c5aa
Expunge session contents between plugin requests

In the NVP plugin, metadata processing performs several plugin operations
with the same context (and db session). The first operation might leave
persisted objects in the session instance which then conflict with objects
created in the second operation.

Closes-Bug: #1266482

Change-Id: Ic9e2b952013610647aa222f1a8b6e33504b54b37
Simplify ip allocation/recycling to relieve db pressure

I found that multiple calls to delete_port can pile up on the
_recycle_ip operation.  This patch simplifies this operation.  It
reduces the _recycle_ip operation to a single row delete in the ip
allocations table and doesn't touch the availability table.

To acheive the recycling of ips in a pool, this code runs a more
complex operation of rebuilding the availability table when it is
exhausted.  Only one API process will perform this more expensive
operation and others waiting for allocation will immediately benefit.
The amortized cost of this operation is much less than the cumulative
cost of running the more expensive _recycle_ip operation for every
port delete.

IP allocation behaves a bit differently with this patch.  Instead of
giving out the first IP available in a pool, the entire pool will be
allocated before wrapping around and recycling ip addresses that have
been released.  This is a desirable feature as it puts ip addresses in
a sort of quarantine after they are released.  It is easier to
distinguish newly allocated ips from old ones.

Change-Id: Ia55b66128de9986e075b0f87acc401d211cd91d3
Closes-Bug: #1252506
Closes-Bug: #1257815
Tweak version nvp/nsx version validation logic for router operations

This patch improves how the nsx/nvp controller version is validated
prior to some router operations. This is done by greatly simplifying
the boolean condition.

Missing unit tests are also added for increased coverage.

Closes-bug: 1274361

Change-Id: I1b21444fd86b6e6a0c72bb5a43f1707934dd70e4
Configure floating IPs addresses after NAT rules

Change the behaviour of the L3 agent in order to set the IP addresses
for the floating IPs on the external gateway interface after the
relevant NAT rules have been applied.
This will avoid a transitory period in which the floating IP exists
and is reachable but it not yet wired to the actual target.

Partial-Bug: #1265505

Change-Id: Ib382fde021868bab2185f2fa5bdee86559148ba7
Fix error message typo

 * Fix error message typo in "_network_admin_state"
   function where "Network Admin State Validation Falied"
   should be changed to "Network Admin State Validation Failed"

Change-Id: I767e93c300250b4422e3980f799862ceb976c951
Closes-Bug: #1276409
Signed-off-by: Fawad Khaliq <fawad@plumgrid.com>
Imported Translations from Transifex

Change-Id: I05e158928b76ba1d8aeb1b74fcf07035e419825d
Merge "Configure floating IPs addresses after NAT rules"
Merge "Fix error message typo"
Merge "Expunge session contents between plugin requests"
Merge "LBaaS: fix handling pending create/update members and health monitors"
Merge "Imported Translations from Transifex"
Merge "Tweak version nvp/nsx version validation logic for router operations"
Merge "[ML2] l2-pop MD handle multi create/delete ports"
Merge "Simplify ip allocation/recycling to relieve db pressure"