Big Switch: Bind IVS ports in ML2 driver

Add support to bind IVS ports in the Big Switch ML2
mechanism driver. The backend controller will be checked
to determine if a host is connected using the Indigo vswitch.
If so, the mechanism driver will mark it as bound since
it will be provisioned by the backend controller.

Implements: blueprint bsn-ml2-bind-ivs
Change-Id: Ic481fc31c8c123899fddf8185c32f127dff53b7a
Implements sync mechanism between Neutron and Nuage VSD

This will sync resources between Neutron and VSD based on
the configuration parameters. "enable_sync" will enable/disable
the sync and "sync_interval" will control the time interval
between consecutive sync cycles.

DocImpact

Change-Id: I6730bf0166dfd1e35795b679293a2831b5afbc75
Implements: blueprint nuage-neutron-sync
Remove SELECT FOR UPDATE use in delete_firewall

SELECT FOR UPDATE expression, which is triggered with the use of the
SQLAlchemy Query object's with_lockmode('update') method, is
detrimental to performance and scalability of the database
performance code in Neutron due to the lock contention it produces.

SELECT FOR UPDATE can be entirely avoided in delete_firewall method
with the use of single-shot DELETE expressions.

Partial-Bug: #1364358
Change-Id: Ia8db73312f5dff6a5bd573694a60a798279834cb
BSN: Bind external ports in ML2 driver

Add a binding capability to the Big Switch ML2 mechanism
driver to mark external ports as bound. Ports with the
owner type 'neutron:external_port' will be assigned to the first
VLAN segment available in the network. The port update operation
will then carry the HOST ID with the identifier to the backend
for the necessary fabric configuration.

Implements: blueprint bsn-ml2-ext-attach
Change-Id: I7b749ba5ef9a47b45be24f77656a10ed38e5e6ae
Cleanup rename of get_compute_ports_on_host_by_subnet

A recent merge [1] renamed this method to remove "compute_" from the
name.  Unfortunately, the rename was not done thoroughly.  This patch
cleans that up.  No bug is referenced since this is an obvious
ommission in a recent patch.

[1] https://review.openstack.org/#/c/114141/

Change-Id: I8320bc8deb6dcda586ccff01120270b3ce257ea2
Fix leftover Timeout effecting most eventlet calls

When registering a new eventlet.timeout.Timeout object, eventlet
automatically starts a timer for most (if not all) future eventlet
calls. Normally, eventlet codes do not hold a timeout unless such a
timeout is used or a specific timeout length is specified through
the API, but once a Timeout object is initialized, it is left there
unless canceled.

This change fixes an un-canceled Timeout which causes some
functional tests to fail, reintroduces a fix for bug #1358206,
which was written prior to discovering the uncanceled timeout, and
increases the timeout of a test that depended on this timeout.

Closes-bug: #1358206
Related-bug: #1364171
Change-Id: I1bfc5af6917c525894eecd8b477d787763edbd02
Revert "Skip functional l3 agent test"

This reverts commit 0918ce91e5af5100ee3a4fcd6861741c4f00ac41. The
specified commit skipped a test which caused non-deterministic gate
failures, but the actual reason for the failures was found and fixed
so the skip is no longer needed.

Related-bug: #1358206
Related-bug: #1364171
Change-Id: I9b0d9ad9ad8b62ee92877fc0a6db0323604433ac
Updated from global requirements

Change-Id: Id4037028812b11e088897c6cb1ff3108c0d4e85d
Remove unused arg to config.setup_logging()

The cfg.CFG argument is ignored and misleading.  This change removes it
and updates all callers.

Closes-Bug: #1355565
Change-Id: I2fcece85d1abe848e5c01125cfb62c02f2dcbc86
Reset IPv6 detection flag after IPv6 tests

Resets a module level flag that was being left in the
state that the previous test set it to. This was causing
unrelated tests to fail if the last state was left disabled.

Closes-Bug: #1365829
Change-Id: Id3f6cb680f5d832e21966de7d4fa335c0c59697c
Avoid testing code duplication which introduced testing bugs

SecurityGroupAgentEnhancedRpcTestCase duplicated code in
SecurityGroupAgentRpcTestCase setUp, also
TestSecurityGroupAgentEnhancedRpcWithIptables duplicated
code from TestSecurityGroupAgentWithIptables setUp()
introducing bugs by improper initialization, like a missing
    self.iptables.use_ipv6 = True
which in combination with tests.unit.test_ipv6.TestIsEnabled
produced inconsistent testing results.

Change-Id: Ic0b596b6fe1d8273df197e9426abad818832c00a
Closes-bug: #1365829
Fixes formatting for debug output in neutron/agent/l3_agent.py

The %s format type was missing.

Change-Id: I4efba513f7b0a6e4a21908bf0b05407e74b524c7
Closes-bug: #1366105
Merge "Reset IPv6 detection flag after IPv6 tests"
Stop tracking connections in DVR FIP Namespace

For DVR, connections to external network using floating IPs do not
need to be tracked in FIP namespace because they are being
already tracked in router namespace.
This fix adds iptable rules to not track connections.

Change-Id: I378039e311763d114860cb70ded7349d6580855a
Closes-bug: #1360395
Merge "Fix leftover Timeout effecting most eventlet calls"
Merge "Updated from global requirements"
Merge "Cleanup rename of get_compute_ports_on_host_by_subnet"
Merge "Remove unused arg to config.setup_logging()"
Merge "Remove SELECT FOR UPDATE use in delete_firewall"
Merge "Fixes formatting for debug output in neutron/agent/l3_agent.py"