Fix AttributeError during startup of ovs agent in DVR mode

Make sure the agent starts processing incoming requests only after the entire
initialization is complete. This is done by making explicit when the rpc loop
is supposed to start, i.e. right at the end of the init process.

This fix was necessary because the agent starts processing rpc messages even
though it has not completed the entire initialization of bridges and data
structures; this is usually okay, but in case of DVR, this leads to a
situation where during the the first run, the agent asks the server to be
assigned a MAC address; this in turn leads the server to fanout the generated
MAC to the running agents, the requesting one included; because of the
incomplete setup, the above mentioned error occurs. During subsequent
restarts, the problem no longer appears.

Closes-bug: #1395196

Change-Id: I792697b94fef39971693cf8aff715c270601cecb
openvswitch/ofagent: Remove OVS.enable_tunneling option

The option has been marked deprecated in IceHouse.
Please use AGENT.tunnel_types=gre instead.

DocImpact
Related-Bug: #1195374
Change-Id: Iea6159c5949a63a0b680818a3fd0928d470115bd
Improve performance of get_active_networks_info

RPC 'get_active_networks_info' currently uses nested loop to fill
the network structure with subnet and port info. Speed up this
operation by using itertools.groupby.

Change-Id: If765dd8f2f8010b79eb168179a64dccf940e9cbb
Closes-Bug: #1390356
Avoid unnecessary explicit str() conversion around exceptions

There are number of places like

except Exception as exc:
            LOG.error("Failed to get network: %s", str(exc))

where str() is not needed since %s substitution already does
the same conversion. Also LOG.error could be replaced with
LOG.exception, so argument exc won't be needed at all.

Closes-bug: #1398839

Change-Id: I73cc6e1ce55ade08e7706b99a5ab075f7059a4ef
Removed unused iso8601 dependency

It should have been removed when migrating to oslo.utils when we dropped
timeutils module from our tree.

Change-Id: I4093a3c8faf3da5790ee31fdebec0b8ed70f84f3
Advanced services support in neutron-db-manage

Partially-Implements: blueprint services-split

Change-Id: Ib8cd77e5e777be83c44b69edc0a6d2d2ba5d2ab1
Cisco: unsupported format character in log format

CiscoCfgAgent.hosting_devices_removed() contains an error in the
format string used to log errors:

    LOG.error(_LE("Invalid payload format for received RPC message "
		"`hosting_devices_removed`. Error is %{error}s. "
		"Payload is %(payload)s"),
	      {'error': e, 'payload': payload})

"%{error}s" should be "%(error)s"

The existing version raises "ValueError: unsupported format character
'{' (0x7b)" when invoked.

(found via pylint)

Change-Id: Ic5e9db2a19aa7652cbbd1ee04d7e02914e8d0093
Closes-Bug: #1403304
Imported Translations from Transifex

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

Change-Id: Ia7bcef7a0efacc79c467b18863cb8180b6a89a28
Add OVS status and fix OVS crash

OVS crash/restart is unpredictable, so neutron-ovs-agent should be
robust enough under that situation. But currently ovs-agent doesn't
figure out this error status(only check ovs restart/normal status)
and still continue to apply subsequent operations(set br/add patch
port/...) till causing exceptions/crash. Add flag to fully represent
ovs status. Base on that, we can add proper fail-over code in method
rpc_loop, to treat ovs dead/restart gracefully to prevent agent
crashes while it is running.
Closes-bug: #1296202

Change-Id: Id058b7ddef2ed337627dc692d0418786ad14f4b4
Move contrib directory to base test directory

This is needed to have post hook apply to both functional and api jobs.

This is aimed at fixing the output for the dsvm-api job in preparation
of the retargatable testing blueprint.

Change-Id: I39e2a7521a7b545a124b1cd42dc79da8986eff93
Merge "Add OVS status and fix OVS crash"
Merge "openvswitch/ofagent: Remove OVS.enable_tunneling option"
Updated from global requirements

Change-Id: I181fc4f2b066eca08f2f23c5d2ff996aa46795ab
Merge "Imported Translations from Transifex"
Merge "Removed unused iso8601 dependency"
Merge "Updated from global requirements"
Merge "Cisco: unsupported format character in log format"
Update heal_script for alembic 0.7.1

Alembic 0.7.1 contains checks of foreign keys so
method check_foreign_keys is not needed anymore.
Heal script should be updated to make it possible to use alembic
methods.

Closes-bug: #1398417

Change-Id: I7d0ba7f00567ae5a4dd0669ed86d6e8d554ca4ec
Backward compatibility for advanced services

Patch implements translation from class paths to neutron to class paths
to neutron_<adv_service>. It's achieved by defining entry point in
setup.cfg which is translated by stevedore.

There will be needed patches in advanced services tree calling
get_provider_driver_class() function before importing class.

This patch specifically fixes loading service plugins and
drivers for service plugin. Patches for agents are still needed in
neutron repo and adv services repos.

Alternative and better solution would be implementing new DriverType
to oslo.config, which will have callback to
get_provider_driver_class()-like function.

Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Change-Id: I76af175c4387326a4e5ff95c2f15d8b866dedab3
Partial-Bug: 1401895
Merge "Advanced services support in neutron-db-manage"