Fix NVP FWaaS occurs error when deleting a shared rule

It is due to the lack of edge_id query index  when deleting the
vcns_edge_firewallrule_binding entry, which leads to deleting
rule binding entrys on both edges.
Closes-Bug: #1322105

Change-Id: I1d15a06bd2a6c42f29c8258d4b9344c8e9338638
changes ovs agent_id init to use hostname instead of mac

In the Open vSwitch agent,
the Agent id is currently based off the mac address of the br-int.
Userspace only Open vSwitch derivatives such as Intel's DPDK
Accelerated Open vSwitch do not currently create a tap device in the kernel
to back the ovs bridges local port.
This limitation prevents reuse of the OpenVSwitch agent between both switches.

To enable reuse of the ovs agent with Intel's DPDK Accelerated Open vSwitch,
the proposal is to change the  generation of the  agent_id to use the hostname,
instead of the mac address of the br-int.

For several plugins such as the nec,mlnx,hyperv and onconvergence agents
the hostname is used to create the agent id.
Using the hostname will normalise the agent_id between these 5 neutron agents,
additionally log readability will also be improved,
if log aggregation is preformed across a cluster
as it will be easier to identify which node the log is from.

the hostname is retrived from cfg.CONF.host

Closes-Bug: #1323259
Change-Id: I9abfac17a74d298f1a17a0931fc98ac00234ac0b
Brocade mechanism driver should be derived from ML2 plugin base class

Change-Id: Iddcb6a43d60d5c9f472912efdecbb2aaa9b7ea4a
Fixes-bug: #1327001
Brocade mechanism driver depends on the brocade plugin templates

This causes problems when the customer installs the ml2
plugin/mechanism driver without the Brocade plugin.

Fixes bug: #1326937

Change-Id: I2d0dfda2cdfbdfd8503351b191151cb02104dcce
Improve vxlan type driver initialization performance

Vxlan type driver may take long time to initialize
vxlan allocation table. Optimize db performance by issuing
raw sql inserts coalesced into bulk statements.
Also optimize deleting logic.

Proposed patch gives ~2x performance gain in comparison with
original code on Mysql and Postgesql backends

Change-Id: I801d967e8e3c0260593f289097d17270ef0b391e
Partial-Bug: #1324875
Allowed address pair: Removing check for overlap with fixed ips

Some of the overlap check has been removed in the following patch:
https://review.openstack.org/#/c/94508/
But the patch did not remove all the overlap check. I remove the
rest part.

Change-Id: I575ec54c0b3d6dc31ef80819d4258c6d162b4cfd
Closes-Bug: #1326007
Big Switch: Remove unnecessary initialization code

Removes a server_timeout parameter that was never set by anything
in the Big Switch plugin and the ML2 driver.

Also eliminates an __init__ method that didn't do anything except
incorrectly log an unset server pool warning before the inheriting
class setup the server pool.

Closes-Bug: #1331249
Change-Id: I77dd22295305b96d4702f1ea0e319dc5f82c71a8
Change default netpartition behavior in nuage plugin

Allows the nuage plugin handle the case where default netpartition
already exists on the VSD (back-end controller)

Change-Id: Ia5785c1c313cf30b8bad6cda1d0e9819784e06d8
Closes-Bug: #1319892
remove pep8 E122 exemption and correct style

This change removes the E122 exemption for pep8. E122 is "continuation line missing indentation or outdented"

Change-Id: I4bd1e6c787648a3dfa69b514efeeff05996aabc1
Partial-Bug: 1329017
Adding static routes data for members

Adding extra data on member entities for routing.
Subnet, mask and gateway data is attached to each member.
Default values are:
 subnet=255.255.255.255
 mask=255.255.255.255
 GW=255.255.255.255

Only in case when LB is connected to both, pool sub-net and vip sub-net
and member is not on pool's sub-net, routing info will be determined
instead of setting to default values:

1. In case when member's port is found, member's subnet and mask
   data will be set to those of the port, gateway will be set to pool's
   gateway address

2. In case when no port found or more than one port found for member's IP address,
   member's subnet will be set to member's IP address value , gateway will be set
   to pool's gateway value, and mask will be set to default 255.255.255.255

New unit tests were added for testing following scenarios:
1. Adding 3 members on 3 different sub-nets, vip's, pool's and other sub-net
2. Adding member on other than pool's sub-net with no port
3. Adding member on other than pool's sub-net with multiple ports with same IP address
   but on different sub-nets

Internal vip graph building function was added (_populate_vip_graph)
for more convenient code re-use and better structure

Change-Id: I6d592ffe8ee3f82f56a4bfbe1d420541871dad2d
Closes-Bug: 1291417
Consistently use jsonutils instead of specific implementation

jsonutils have several benefits in comparison to pure json
implementation, like enabling C boosted encoders and decoders for
Python2.6 by using simplejson when available.

Change-Id: I24d0cd442e8d9d89fac50e43fc97f7bb4a293c3d
Closes-Bug: 1329496
Don't use root_helper when it's not needed

LinuxBridge agent doesn't need to use root_helper when checking if
a device exists. Root priviledges are required to perform operations
inside a namespace and it's not the case here.

Change-Id: I12e0cde2f4dd3b3f8e7f5ed9e90e2805a4466aaa
Closes-bug: #1305800
NSX: revert queue extension name change

The following patch: d7aa2dfcb14b84e2ef3242fb0787200d852d6103 renamed the
nvp-qos extension to qos-queue which breaks the integration with nova as
nova checks for the nvp-qos extension to be loaded and now it's called
qos-queue. This patch adds back nvp-qos for trunk chasers and another
patch will migrate nova from nvp-qos to qos-queue.

Change-Id: I563aed6b6c4551489989f846a619d54020d0b5ee
closes-bug: 1329071
Ensure entries in dnsmasq belong to a subnet using DHCP

In certain configurations, Neutron calculates SLAAC addresses for IPv6
subnets and adds them to the fixed_ips field of a port. Since those
subnets are not being managed by DHCP, do not add those fixed_ip entries
to the host file.

Closes-bug: #1316190
Related-bug: #1257446

Change-Id: I77dd55063296990c9df385f331f5de5d42402786
linuxbridge-agent: process port updates in the main loop

This patch changes the way the linuxbridge agent processes port update
notifications. It does the same for the lb-agent as was done for the
ovs-agent in I219c6bdf63b0b5e945b655677f9e28fa591f03cd.
Now the RPC call just adds the updated tap device name to a set of
updated devices, and the actual processing is done in the main RPC loop.
This should solve the problems were port_update RPCs were competing
with the main loop/greenthread and with each other to do the same task
- like adding a tap or interface to a bridge - which lead to races and
was inefficient. Now repeated port_update notifications received within
a single main loop iteration will be coalesced and processed only once.

Closes-Bug: 1256950
Change-Id: I7fd48542f12b39ffc1346d1a6c9a387ecda6d812
Configure agents using neutron.common.config.init (formerly .parse)

After oslo.messaging port is done, we'll need to initialize RPC layer
from all RPC agents. We'll put initialization into init() function, so
the first step for migration is to make agents use it.

The function is renamed to be explicit about the fact that we don't just
parse configuration by calling it, but also do other common
initializations, like setting RPC layer.

blueprint oslo-messaging

Change-Id: I71c62f270ac7a1ff1426a3f49a32133b65580e35
Don't instantiate RPC clients on import

In oslo.messaging port, we'll need to make sure no RPC clients or
servers or notifiers are created before RPC layer is initialized using
n_rpc.init(). This means that there should be no global objects that
create those objects on __init__.

There should also be no such class attributes because in that case
import will itself instantiate the object, probably before RPC layer is
ready.

blueprint oslo-messaging

Change-Id: Ia8a9fd39777c75e4253f5518c2de6be551cc365b
Don't explicitly call .stop() on mock.patch objects

BaseTestCase already cleans up all mocks via .stopall(), so there is no
need to do it in each test case.

Change-Id: I7165ea9682a3dce3a76e90e309b763c939729d84
Make sure we call BaseTestCase.setUp() first

Some test cases instantiate RPC clients in setUp() before calling to
super(). After we port to oslo.messaging, we'll initialize RPC layer in
BaseTestCase, so we should make sure we call there before proceeding
with clients in subclasses.

blueprint oslo-messaging

Change-Id: I6fdcba0ba690c75d1a472b3ad050c21f5f53a1d0
Add vlan type driver unittests

Closes-Bug: #1269127

Change-Id: Ie2c1c5d2eea6627063dd77a08591d972060f59ee