Minor lbaasv2 things from the feature branch, needed in neutron

- Minor neutron.conf fix from feature branch until config is moved
- Some extra constants for extension
- Jinja template entry in services.conf

Change-Id: I4a15d0ac422457d2286d4b24d9f5067047e81563
Partially-Implements: blueprint services-split
Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com>
Add metadata proxy L3 agent driver

To-Do:
* vArmourL3NATAgent (Before this patch) overrides _spawn/destroy_metadata_proxy
  with empty stubs. This behavior should be maintained so that the metadata proxy
  is not created when using vArmourL3NATAgent. It also overrides _router_added
  and _router_removed, causing L3 agent driver notifications to not send out.

Partially-implements: blueprint restructure-l3-agent
Change-Id: I36900b02bff34269f789956aa324379ff51eb81b
Remove NSX 'service' plugin

Following the spin-off for Neutron advanced services, this plugin
has become non-functional.
This patch removes the plugin, the service drivers, the database
models which kept tracking of resource associations, exceptions,
and obviously unit tests.

As there were some extensions which were leveraged only by this
plugin, they are being removed as well. In particular, one of
these extensions, 'routed-service-insertion' was in the
neutron.extensions package rather than neutron.plugins.vmware
package. This was for historical reasons. As no other plugin is
using this extension, it is being removed as well with this
patch.

By removing this plugin vmware the temporary skips applied to
neutron unit tests can be lifted. This patch does this.

Closes-Bug: #1403585

Change-Id: I0717f955b0f787c2951cb9db44ea5decc5d3dff0
Scope dhcp rpc api using a messaging namespace

This patch updates the rpc API used by the DHCP agent to make calls
back into the neutron plugin to use the 'dhcp' namespace instead of
the default namespace.  The reason is that this API is exposed over
the 'q-plugin' topic along with several other interfaces.  Without the
use of namespaces, all of the interfaces are effectively treated as
one by oslo.messaging.  When a namespace is used, the interface can be
versioned independently and when a method is called, the only class
considered for fulfilling the request is the one that claims to
implement the 'dhcp' namespace.

While we're here, add documentation to both the client and server side
of this interface that indicates where the other side is located.

Part of blueprint rpc-docs-and-namespaces.

Change-Id: I9e56aa34fc560ae3fc749c51788436e32179d0a1
Merge "Add metadata proxy L3 agent driver"
Merge "Remove NSX 'service' plugin"
Revert "Add metadata proxy L3 agent driver"

This reverts commit 6b38f29fdbd077434f1f7139466479e81bf4882d.

Because it broke the functional job.

Change-Id: Ibcc577ade490663820f0a4f599afc6127a6e52e6
Merge "Revert "Add metadata proxy L3 agent driver""
Copy the contrib directory instead of moving it

This is necessary because pbr is stupid enough not to be
able to handle symlinks. The initial symlink was necessary to
avoid breaking the functional job. Once change [1] merges we
can drop the old contrib directory.

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

Change-Id: I683009b1c5b3520e5f9f2c17a9a0dabefdeebe45
Merge "Scope dhcp rpc api using a messaging namespace"
Prevent symlinks to be added to the tree

Symlinks cannot be allowed because they are not supported by distutils.
Adding them results into package build failures.

This patch add a check that verifies that no symlinks can slip in.

Closes-bug: #1404605

Change-Id: I0d308127081bb2fa4ff7d7e0ed2f1b6e915163c9
Merge "Minor lbaasv2 things from the feature branch, needed in neutron"
Update L3 agent drivers singletons to look at new agent

L3 agent drivers are singletons. They're created once, and hold
self.l3_agent. During testing, the agent is tossed away and
re-built, but the drivers singletons are pointing at the old
agent, and its old configuration.

Change-Id: Ie8a15318e71ea47cccad3b788751d914d51cbf18
Closes-Bug: #1404662
Fix typo'd format parameter in midonet_lib.py

In add_static_nat(...):

        LOG.debug("MidoClient.add_static_nat called: "
                  "tenant_id=%(tenant_id)s, chain_name=%(chain_name)s, "
                  "from_ip=%(from_ip)s, to_ip=%(to_ip)s, "
                  "port_id=%(port_id)s, nat_type=%(nat_type)s",
                  {'tenant_id': tenant_id, 'chain_name': chain_name,
                   'from_ip': from_ip, 'to_ip': to_ip,
                   'portid': port_id, 'nat_type': nat_type})

Note port_id vs portid.  This line of code raises a KeyError if debug
logging is enabled.

(Found via pylint)

Change-Id: I4d76255a559489f2f0e074b4489cfa5f33f1dddf
Closes-Bug: #1404755
ml2: remove superfluous %s in LOG.debug() format

ml2.db.get_dynamic_segment() includes this line:

   LOG.debug("No dynamic segment %s found for "
	     "Network:%(network_id)s, "
	     "Physical network:%(physnet)s, "
	     "segmentation_id:%(segmentation_id)s",
	     {'network_id': network_id,
	      'physnet': physical_network,
	      'segmentation_id': segmentation_id})

Note the superfluous %s in the format string.  At run-time, %s prints
the args hash again and doesn't cause an error, but this is clearly
unintended.

Since there doesn't seem to be any value that was meant to be used
instead, this change simply removes the %s.

Change-Id: I414c7b4497f59927d8b6ec5f057dca19aa4ef122
Closes-Bug: #1404782
Use lazy logging interpolation

There are a small number of examples of "eager" interpolation in
neutron:
  logging.debug("foo %s" % arg)

These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.

This change addresses all such current examples found in neutron core
via a pylint test.  Vendor plugins and services are fixed elsewhere.

Change-Id: I823d8453cd76e4985cabd31ca6b939f43a80b36c
Partial-Bug: #1404788
bigswitch: Use lazy logging interpolation

There are a small number of examples of "eager" interpolation in
neutron:
  logging.debug("foo %s" % arg)

These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.

This change addresses all such examples found in bigswitch via a pylint
test.  Other occurrences are addressed elsewhere.

Change-Id: I23fd4e7d0e4173e753a124d62a1563ce6ac674ca
Partial-Bug: #1404788
embrane: Use lazy logging interpolation

There are a small number of examples of "eager" interpolation in
neutron:
  logging.debug("foo %s" % arg)

These should be converted to perform the interpolation lazily within
the logging function, since if the severity is below the logging level
then the interpolation can be skipped entirely.

This change addresses all such examples found in embrane via a pylint
test.  Other occurrences are addressed elsewhere.

Change-Id: Iabceb8c7d32111ae97d1200fbd25681e317f7bb7
Partial-Bug: #1404788
PLUMgrid plugin: Fix for delete subnet with admin context

When delete call using admin for a subnet created from a
non-admin project is made, the tenant_id passed to backend
happened to be of admin project. This commit fixes the issues
by getting the correct tenant_id.

Closes-Bug: 1404688
Change-Id: Id21c38610ed73defb937d971a7aade57713541c0
Merge "Fix typo'd format parameter in midonet_lib.py"