Add support for multiple RPC workers under Metaplugin

Metaplugin needs a fix to support multiple RPC workers properly
because a plugin which supports multiple RPC workers cannot
initialize RPC connections at plugin initialization.

Closes-Bug: #1300570
Change-Id: I584f70abb8969054cd4edc8f914d00f6be930bab
(cherry picked from commit 8fb023ed53aff31f37ebebb94aca4f8e2a188342)
Fixes Hyper-V agent security group ICMP rules

Converts ICMP protocol to the equivalent protocol number.
Adds default ICMP reject rules.
Adds default ANY protocol rules if the rule does not
contain any protocol.

Closes-Bug: #1299159
Change-Id: Iff51a58fdb532eda0fe7a63abf96004ee74bb073
(cherry picked from commit f56972193be903c67cd54c57bcc2becf6222aced)
Fixes Hyper-V agent security groups disabling

Adds a check if the security groups have been disabled and removes
the switch port's ACLs accordingly.

Change-Id: I20d716a3f182b8ea62da6b436b150aa9dafdb1c5
Closes-Bug: #1299156
(cherry picked from commit 6d49834976bc08d2b8f7939bc2a217f5cc81db47)
Make default nova_url use a version

The default nova_url for neutron is missing an API
version number. This can cause requests to fail
because the Nova /versions API cannot respond
to Neutron notification requests.

It seems reasonable for the default value to
at least have a chance at being correct so
this patch upgrades the default Nova API url to
use the Nova 'v2' API.

Related-bug: #1298640
Change-Id: Ib1449de84fbc01fb704ebfe4a016ac8f4932be96
(cherry picked from commit c09a14089a5ca7cd3093895ee0248876499a6d06)
NSX: ensure that no LSN is created on external networks

Logical Service Nodes (LSN) are those that provide dhcp
and metadata services to networks when the NSX plugin is
used without the openstack dhcp and metadata proxy
agents. External networks do not work with Neutron's
dhcp and metadata services, therefore there is no need
to provision a LSN in this case.

Added UT to avoid regression.

Closes-bug: #1316795

Change-Id: I3dab0c9cbecdd9296466c991d02d590d6bd5bd49
(cherry picked from commit af020da544ac4cf21b293d23710545ee5cdcdfa4)
NSX: allow net-migration only in combined mode

To allow migration of networks from the agent based model
to the agentless one, both modes need to be available; prior
to this change the extension was available in 'agentless' mode
too; this may lead to leftovers during the migration step.
This patch makes the extension available in 'combined' mode
only, which was the intended behavior.

Change-Id: I491ee3eaf25fc30c0ab4092ee198802a6b06d91d
Closes-bug: #1313985
(cherry picked from commit e737076c374d0743927782b6318132ecf226f05a)
Common decorator for caching methods

Decorator caches methods' results, the key is composed from function
name and its parameters. Implementation of cache itself should be in
object implementing decorated method. Cache backend should be taken
from oslo-incubator.

Related-Bug: #1276440

Conflicts:
	neutron/common/utils.py

Change-Id: Ibe3f1b2eb10b9601ad76ec24b7f0e3551b4013e2
(cherry picked from commit 7508170498949818aed02ba0fd9b7f861e596320)
Replace loopingcall in notifier with a delayed send

The loopingcall thread here was started before processes fork and so
the thread stops working after the fork call.  This is a problem that
will probably need to be worked out in the long run.

To ensure that this notifier works correctly in all processes, this
change replaces the persistent loopingcall thread with a thread
created on demand to delay and batch up notifications.  The first
notification will trigger spawning the thread to wait to send it.  Any
notifications that come in the meantime will notice that there is
already a thread waiting to send and will return without spawning.

Conflicts:
        neutron/notifiers/nova.py

Change-Id: I519d4e89b8cee341c0e1cfffbce3e77151e8202a
Closes-Bug: #1301035
(cherry picked from commit 3be1d7a75c5ec754825e99e0a8d95b4e1521ae4b)
Use os.uname() instead of calling uname in subprocess

Related-Bug: #1291535

Change-Id: I57e18c0b95904f318e3fff08cd18b32e28f48834
(cherry picked from commit 22a0692c2e9b0276c6b4dd2f66cedc70f7f835a5)
Wrong key router.interface reported by ceilometer

Ceilometer with MongoDB doesn't accept the key with dot.

The dot in 'router.interface' should be replaced with '_',
which is also the standard implementation of other keys in neutron.

Change-Id: If7fcf7658db9ee2d7d1248bb0b016b4389c32c77
Related-Bug: #1310460
(cherry picked from commit 7811c8a8ffce78dc14815203858854c450f1c8f6)
Remove List events API from Cisco N1kv Neutron

Earlier Cisco N1kv plugin was using list events api to
poll policies from VSM.
It was inefficient and caused delay in processing.
So, now Cisco N1kv plugin  switched to list profiles to
poll policies from VSM.

Change-Id: Ia734735361dc3eaee8e276ada0c80045eaa9ef96
Closes-Bug: #1292173
(cherry picked from commit e0f69d69293f0ffba22a6540f483f05baa48cd6f)
NEC plugin: Bump L3RPC callback version to 1.1

update_floatingip_statuses RPC call implemented in Icehouse expects
RPC version 1.1 and RPC version of L3RpcCallback of other plugins
was bumped to 1.1, but the version of L3RpcCallback in NEC plugin
was not bumped to 1.1 yet.

Change-Id: I0073a3de9ea0cd59d43c821f9bdaea89bd125a65
Closes-Bug: #1323769
(cherry picked from commit e588ee5b470bdca25abc634db3144d2aa9b84554)
Merge "Make default nova_url use a version" into stable/icehouse
Merge "Use os.uname() instead of calling uname in subprocess" into stable/icehouse
Merge "Replace loopingcall in notifier with a delayed send" into stable/icehouse
NSX: fix bug for flat provider network

The flat provider network would cause an exception when writing to
database. This is due to the fact that the DB expected an integer
and received an object instead.

Change-Id: Ib9d38711c0c2ef16d8bf74bfae44864a1bc272b1
Closes-bug: #1324120
(cherry picked from commit 84dfaa8a87cce660aa20619bd93263e645bbb2d0)
Added missing plugin .ini files to setup.cfg

Some plugin .ini configuration files were missing and hence not
installed via 'setup.py install'.

Conflicts:
	setup.cfg

Change-Id: I31f096e7fbf9f7a182ba8535ca8cadc4fecc6632
Partial-Bug: 1324487
(cherry picked from commit a75e156af64afb61f3ebf928eda132325e5a46f5)
Reprogram flows when ovs-vswitchd restarts

When OVS is restarted, by default it will not reprogram flows which were
programmed. For the case of the OVS agent, this means a restart will cause
all traffic to be switched using the NORMAL action. This is undesirable for
a number of reasons, including obvious security reasons.

This change provides a way for the agent to check if a restart of ovs-vswitchd
has happened in the main agent loop. If a restart of ovs-vswitchd is detected,
the agent will run through the setup of the bridges on the host and reprogram
flows for all the ports connected.

DocImpact
This changes adds a new table (table 23) to the integration bridge, with a
single 'drop' flow. This is used to monitor OVS restarts and to reprogram
flows from the agent.

Conflicts:
	neutron/plugins/openvswitch/common/constants.py

Change-Id: If9e07465c43115838de23e12a4e0087c9218cea2
Closes-Bug: #1290486
(cherry picked from commit 8e9f00a19dab98e5cfc7ca32beb9f17ebb5bc1bb)
Merge "Remove List events API from Cisco N1kv Neutron" into stable/icehouse
Merge "NSX: allow net-migration only in combined mode" into stable/icehouse