Fix downgrade in migration

In 63afba73813_ovs_tunnelendpoints_id_unique migration mistake in
usage drop_constraint parameter type_ and positional agruments name
and table_name.

Closes-Bug: #1243073

Change-Id: I60cd6e7f18b193b71f8f20759251b9f59a79965a
Apply six for metaclass

__metaclass__ cannot be used in python3.
six be used in general for python 3 compatibility.

Change-Id: Ib0d71b9676dc01390679396443575c05975d3b58
Closes-Bug: #1236648
Added check on plugin.supported_extension_aliases

Added check to neutron.api.extensions.PluginAwareExtensionManager
which raises an exception when an alias in the plugin's
`supported_extension_aliases` list is not found in the set of loaded
extension aliases. If an alias is missing, it means the extension for
that alias has not been loaded, has not been found, and the file is
missing from paths listed in `oslo.config.CONF.api_extensions_path`.

This guards against a common class of bugs in plugins,
such as typographical errors in the `supported_extension_aliases`
property.

Plugin changes:

* bigswitch.plugin: Moves api_extensions_path override to plugin's
__init__ method, similar to other plugins.

* cisco.n1kv.n1kv_neutron_plugin: Removes "policy_profile_binding" and
"network_profile_binding" as they don't exist in Neutron currently.
Removed override of api_extensions_path as it is loaded through
cisco.network_plugin.

* cisco.network_plugin: Renames "Cisco Credential" to "credential".
Adds api_extension_path override to plugin's __init__ method.

* metaplugin.meta_neutron_plugin: Avoids alias of empty string when
cfg.CONF.META.supported_extension_aliases is an empty string.

* midonet.plugin: Fixes regression of 98e16a06 from 715b16ac.

* nec.nec_plugin: Extended override of api_extensions_path to append
nec extensions path to existing configured path.

* nicira.NeutronPlugin: Extended override of api_extensions_path to
append NXP_EXT_PATH to existing configured path.

Fixes: bug 1225080

Change-Id: Idcaade221d83c611fcbd87b503b2c8377d106962
Optionally delete namespaces when they are no longer needed

Adds a configuration option to tell the network agents to delete
namespaces when they are no longer in use.  The option defaults to
False so that the agent will not attempt to delete namespaces in
environments where this is not safe.

This has been working well in deployments where iproute2 has been
patched with commit 58a3e8270fe72f8ed92687d3a3132c2a708582dd or it is
new enough to include it without being patched.

Change-Id: Ice5242c6f0446d16aaaa7ee353d674310297ef72
Closes-Bug: #1250596
Related-Bug: #1052535
Handle IPAddressGenerationFailure during get_dhcp_port

If a network/subnet is deleted while the dhcp agent is trying
to get/create a dhcp port for that network, the exception
will be raised because no IP Allocation Range is available.

However, this particular failure mode causes just noise, because
the dhcp agent can cope with it without problems.

A follow-up patch will deal with the other exception traces during
create_dhcp_port

Partial-bug: #1253344

Change-Id: I7fe35455ce905daa22ff96367e120864a7d3fb92
Avoid dhcp agent race condition on subnet and network delete

Ensure that ports that are about to be deleted are 'selected
for update'. By doing so, we avoid a race condition between
subnet and network delete operations carried out by two
separate server instances.

A race caused by the dhcp agent deleting the DHCP port
(caused by a subnet-delete event notification) can
still occur and will be addressed in a subsequent patch.

delete_subnet's way to delete ports has been tweaked to
ensure that postgres db can handle the SELECT FOR UPDATE
correctly.

Partial-Bug:1197627

Change-Id: I5bd75a758395a2faeff9db35a03c42dfa8ae0eab
Fwaas can't run in operating system without namespace feature

Adding the check before generating the local_ns_list
to fix the issue.

Change-Id: If8edb5c0bb0fc0fd9aaf48a3441287f99bcdcf13
Closes-Bug: #1252201
Fix showing nonexistent NetworkGateway throws 500 instead of 404

Change-Id: I5304bd52f7a5ae22fbc0d48206d7c1d282b34a91
Closes-Bug: #1252921
Rebind security groups only when they're updated

Update the security port bindings for a port only when they actually
differ from the stored value.

This will also avoid sending port_update notifications to the agent
even if nothing actually changes in the port configuration.

Closes-Bug: #1255183
Partial blueprint: neutron-tempest-parallel

Change-Id: I00c29dc97c46478433fdf08069a884bb78e5cd0a
Mocking ryu plugin notifier in ryu plugin test

Previously RPC notifier is not mocked in ryu plugin test and the
plugin tries to send RPC notifications. It may interact with
impl_fake RPC set up in previous tests by other plugin
and sometimes leads to unexpected ovs-vsctl invoking.

Change-Id: I11714a160faa4d3ded7f312c39afba0b426ccd8a
Closes-Bug: #1255421
Merge "Mocking ryu plugin notifier in ryu plugin test"
Merge "Fix downgrade in migration"
Merge "Rebind security groups only when they're updated"
Merge "Added check on plugin.supported_extension_aliases"
Merge "Apply six for metaclass"
Merge "Avoid dhcp agent race condition on subnet and network delete"
Merge "Handle IPAddressGenerationFailure during get_dhcp_port"
Merge "Fwaas can't run in operating system without namespace feature"
Stop logging unnecessary warning on context create

The context was previously logging at the 'warn' level when unknown
kwargs were being passed to its __init__().  Since the agents were
passing tenant=None with each rpc request, this was generating an
unreasonable amount of log chatter that would not be useful to an
operator.  The fix is to log at the debug level instead so that
the operators don't see the output by default but developers can
still choose to.

Change-Id: I5c328f628c597eb949c1fe67b23120d2b5d1c7da
Related-Bug: #1254530
Partial-Bug: #1255441
Merge "Stop logging unnecessary warning on context create"