Avoid notifying while inside transaction opened in delete_port()

delete_port() calls to disassociate_floatingips() while in transaction.
The latter method sends RPC notification which may result in eventlet
yield. If yield switches a thread to another one that tries to access
the same floating IP object in db as disassociate_floatingips() method
does, we're locked and get db timeout.

We should avoid calling to notifier while under transaction.

To achieve this, I introduce a do_notify argument that controls whether
notification is done by disassociate_floatingips() itself or delegated
to caller. Callers that call to disassociate_floatingips() from under
transactions should handle notifications on their own. For this,
disassociate_floatingips() returns a set of routers that require
notification.

Updated drivers to reflect new behaviour. Added unit test.

Conflicts:
	neutron/db/l3_db.py
	neutron/plugins/bigswitch/plugin.py
	neutron/plugins/nuage/plugin.py

Change-Id: I2411f2aa778ea088be416d062c4816c16f49d2bf
Closes-Bug: 1330955
(cherry picked from commit 876c2c25e15806529f4e197cd265bc3b2184aa14)
VMWare: don't notify on disassociate_floatingips()

L3 agent notifications don't make sense for NSX VMWare plugin since
there is no L3 agent in such setup, so disabling them here.

Updated a unit test to check that notification is indeed not requested.

Conflicts:
	neutron/tests/unit/vmware/test_nsx_plugin.py

Change-Id: I9c7c32d02d466098d22df8f10448361c3d99174c
Related-Bug: 1330955
(cherry picked from commit eafebec2d3f6d0bd0ecc6e6d7c4f1ae421a44dfe)
Add configurable http_timeout parameter for Cisco N1K

http_timeout is a constant defined in the code. This change makes it
configurable by providing it as an option in the config file.

DocImpact

Conflicts:

        etc/neutron/plugins/cisco/cisco_plugins.ini
        neutron/plugins/cisco/common/config.py

Closes-Bug: #1332290
Change-Id: I429dd9efa43f6a596933359f4627a7761411e621
(cherry picked from commit a8d67485ab498a647b1f50184755c47b18e97e2c)
Fix deprecated opt in haproxy driver

If Neutron was updated from Havana, lbaas config file defines user_group
and loadbalancer_state_path in default section but since Icehouse these
settings were moved to haproxy section.
This patch adds DEFAULT group to DeprecatedOpt.

Conflicts:
	neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py

Change-Id: Ic92d4bc81ff6a3b16799414d17ac52e7a4801796
Closes-bug: #1349767
(cherry picked from commit cd3f4f7d24c92475ca698906c57f60375861b83f)
Ignore variable column widths in ovsdb functional tests

The ovsdb tests check the output of "ovsdb-client monitor" before and after
some operations. The first line of output is a header row with spaces for
column separation. The column widths can vary depending on the data in the
columns, so compress multiple spaces to one for testing.

Change-Id: I6b4690ea9ef1c1b215411ca2c39b1e65fec2c6c7
Partial-bug: #1336172
(cherry picked from commit 17686c1f24ddf1977bbd930ce94b3e3d76962c5b)
Big Switch: Only update hash header on success

This patch moves the hash update call into the success block
of the server manager so the database isn't updated with
a hash header from an error response. Additionally, it prevents
the hash from being updated to an empty value if the hash header
is not present in the response.

Conflicts:

	neutron/tests/unit/bigswitch/test_servermanager.py

Closes-Bug: #1348766
Change-Id: I512d01f9bb91b208dd58883d2464951ecc6748e1
(cherry picked from commit b8cf45218714937681d7df2e5b9d7d440cb2edd9)
Merge "Add configurable http_timeout parameter for Cisco N1K" into stable/icehouse
Merge "Fix deprecated opt in haproxy driver" into stable/icehouse
Merge "Avoid notifying while inside transaction opened in delete_port()" into stable/icehouse
Verify ML2 type driver exists before calling del

Verifies that an ML2 type driver exists for a given
segment type before attempting to call the release_segment
method on it. Logs an error if a type driver is not
found.

This covers the case where a segment is created with
a given type and then ML2 is reconfigured without
support for that type.

DocImpact
The ML2 documentation should be updated with a warning
that disabling a network type driver and re-enabling
it later may lead to possible DB inconsistencies.

Closes-Bug: #1292102
Change-Id: I65a35abf3ed57347bb6e8fee228f8c0697217c00
(cherry picked from commit af89d74d2961db6a04572375150ad908c9e72e78)
Bump stable/icehouse next version to 2014.1.3

Bump stable/icehouse next version to 2014.1.3

Change-Id: I7a71b42bc99b66dedc99fb8b299e898d51d6e62b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Clear entries in Cisco N1KV specific tables on rollback

During rollback operations, resources are cleaned up from neutron
database but leaves a few stale entries in the n1kv specific tables.
This change addresses the proper clean up of tables. i.e. VLAN/VXLAN
allocation tables, profile binding and vm network table.

Conflicts:

        neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py

Change-Id: I7a09d34f3a9dee0a43b76c5d781ee9eb9938953a
Closes-bug: #1336596
(cherry picked from commit 73b4239fbef5e52494cf3ffc3293dbb79b52d91c)
Merge "Ignore variable column widths in ovsdb functional tests" into stable/icehouse
Merge "VMWare: don't notify on disassociate_floatingips()" into stable/icehouse
Remove explicit dependency on amqplib

kombu already depends on amqp or amqplib depending on its
version, and no explicit access to amqplib exists in neutron code.

Conflicts:
	requirements.txt

Closes-Bug: #1317094
Change-Id: I5cf189d7173b732cba6df3f9b6aff1d2bb85cdfe
(cherry picked from commit 39ffcb0dd75d9dc5d8a249f2974a67f0def5204b)
Merge "Bump stable/icehouse next version to 2014.1.3" into stable/icehouse
Ensure ip6tables are used only if ipv6 is enabled in kernel

On systems where ipv6 module is not loaded in kernel we need to avoid
usage of ip6tables. This patch reads
/proc/sys/net/ipv6/conf/default/disable_ipv6 file and if ipv6 is
disabled then ip6tables are not used in IptablesManager

Closes-Bug: #1352893

Conflicts:
	neutron/agent/l3_agent.py

Change-Id: I07e5851aa25eb98b7a97dff86b9850475df85f64
(cherry picked from commit b6e9922364fca4d8d141fbb2f27024f7db79ca9e)
Fixes Hyper-V issue due to ML2 RPC versioning

The ML2 RPC version 1.1 breaks the hyper-v agent and
consequentially the RPC version in the Hyper-V agent needs
to be set to 1.1 to match the ML2 RPC base API version.

Conflicts:
	neutron/plugins/hyperv/agent/hyperv_neutron_agent.py

(cherry picked from commit 771327adbe9e563506f98ca561de9ded4d987698)

Change-Id: Idc4ae8d7dcff4331aca148a8f2a7a2b01679b3a8
Closes-Bug: #1353697
Fixes Hyper-V agent issue on Hyper-V 2008 R2

The vmutils.HyperVUtils class used on versions of Hyper-V prior of 2012
is missing the "remove_all_security_rules" method.

Change-Id: Ib14e643c400b230c912589f9480acf59d6e7b147
Closes-Bug: #1360817
Add hook scripts for the functional infra job

Infra jobs support hooks to customize behavior.  This change adds
scripts that are intended to be called by the neutron-dsvm-functional
jobs as hooks.   Defining hook behavior in-tree instead of directly in
the job definition has the advantage of allowing changes in hook
behavior to be tested before merge.

The gate_hook.sh script added by this change installs a rootwrap
filter to allow functional tests to destroy python processes that
they have spawned.  The tests use the python executable provided by
their tox env, and the default rootwrap configuration does not
support killing processes launched by non-system python executables.

This change will have to merge to master and stable/icehouse before
the supporting infra config change can be merged:

https://review.openstack.org/#/c/116458/

Partial-bug: #1360658
Change-Id: Idcc6195f91fac833c14892f27fb793048ef964b9
(cherry picked from commit 31ca6ea1412ca30c708f52ef844f5a2eedb7a56d)