LBaaS: small cleanup in agent device driver interface

remove unnecessary 'context' parameter

Change-Id: Iaa3896f89760817af9d72e653252830f8a33e390
Closes-Bug: #1294096
Advanced Services documentation

Adds the beginnings of documentation for the Firewall as a Service,
Loadbalancer as a Service, and VPN as a Service.

Part of blueprint developer-documentation

Change-Id: I5e46df2dc4f87f961490ee75791a7e825ea94e1e
Merge "NSX: Ensure gateway devices are usable after upgrade"
ML2 BigSwitch: Don't modify parent context

Makes a copy of the port context before changing
it in preparation for the backend controller so
other drivers are not affected. Also removes a
UT that was exercising direct modification of VIF
details in the port context, which is not allowed
by the ML2 plugin.

Closes-Bug: #1294308
Change-Id: I47281dcd23c022813b8b6eda0a3d39c4482277b9
Fixes Hyper-V agent security groups enable issue

Fixes the weight of the applied allow rules by ignoring
the weight of the reject rules.
Fixes the override allow rules issue by fixing the
ACL filtering condition.

Change-Id: I38ddd7142d0fa45f308460153d29580f276ce07e
Closes-Bug: #1294368
Don't use root to list namespaces

A bit of low hanging fruit.  I just noticed that this hadn't been
fixed yet.

Change-Id: Iea9210098b6acf4ab24a89287529ff82986faaad
Closes-Bug: #1293818
Cisco Nexus: maximum recursion error in ConnectionContext.__del__

If DevStack is configured for the Cisco Nexus plugin, the following
error is observed:

Exception RuntimeError: 'maximum recursion depth exceeded' in <bound
method ConnectionContext.__del__ of
<neutron.openstack.common.rpc.amqp.ConnectionContext object at
0x403a3d0>> ignored

The root cause of the problem is that the Cisco Nexus plugin's
PluginV2.__gettattr__ method, a model object is being passed
as a value for a unicode %s format mod. Because the neutron server
has "lazy gettext" (deferred interpretation of unicode objects) enabled,
this causes many layers of recursive calls to deepcopy.

The fix is to pass a string object for the unicode %s mod field.

Change-Id: I0a07a0ab417add68e44cb1bca722cb0b4a71205b
Closes-Bug: #1286565
Cisco plugin fails with ParseError no elem found

When the Cisco nexus plugin is configured on DevStack, the tempest
Neutron API test test_port_list_filter_by_router_id fails with the
following error:
     ParseError: no element found: line 1, column 0

The root cause is that the Cisco Nexus plugin model layer
is encapsulating each dictionary response from the OVS subplugin
into a list, whereas the WSGI layer is expecting a dictionary
response. The fix is not to encapsulate these responses into a list.

Change-Id: I4b589e8e5696c0eae43cafc46912b3d7f29bbdb6
Closes-Bug: #1284162
Allow CIDRs with non-zero masked portions

Allow users to specify CIDRs with bits other
than zeros in the masked portion of the subnet.
e.g. 192.168.1.5/24 is accepted and converted
to 192.168.1.0/24.

Closes-Bug: #1204173
Change-Id: I7ddff41e6988feb6e2a87e40a4d99db7174415b1
Mock agent RPC for FWaaS tests to delete DB objs

This changes the firewall service unit tests to
mock the RPC calls from the firewall service to
the agent. This allows the tests to fake the
agent response RPC that removes the firewall
from the DB so the all of the other objects that
the firewall depends on can be deleted.

Closes-Bug: #1288441
Change-Id: I32462ab5557b9c52328bf6a23a12efc2d799644c
Ensure to count firewalls in target tenant

Previously admin tenant cannot create a firewall if other tenant
already created a firewall. We need to count firewalls only in
a target tenant.

Change-Id: I3e6d151d00d4a487bdd858e94929fab8960511a2
Closes-Bug: #1258438
Enable to select an RPC handling plugin under Metaplugin

Multiple plugins under metaplugin become 'q-plugin' topic
consumers and a request from an agent is handled by one of
them randomly. Fortunatly most of RPC callbacks are common
for plugins but a problem occurs if an RPC is not supported
by the received plugin.

This is one of risks when using metaplugin. Fundamental fix
of this problem (such as RPC delegation handling of metaplugin)
is difficult since each plugin needs to modify.
But when only one plugin has plugin specific RPCs and other
RPCs are independet of plugins, if the plugin can be selected
for RPC handling, the problem does not happen. Typical use
case of metaplugin such as combination of an agent-based
plugin and a controller-based plugin often applies to this
condition.

This patch adds 'rpc_flavor' configuration parameter to
select an RPC handling plugin. If 'rpc_flavor' is specified,
only the specified plugin becomes 'q-plugin' topic consumer.
If 'rpc_flavor' is not specified, the behavior is same as
previous one.

Change-Id: If133b054bba53829cebe63c1e0ebe6099eb1fd95
Closes-bug: #1267330
DocImpact
Merge "Kill 'Skipping unknown group key: firewall_driver' log trace"
return false or true according to binding result

Change-Id: I23a47c6c7c9be989e65c144b2277c42eeaaade3f
Closes-Bug: 1294500
Add update binding:profile with physical_network

Add temporary solution in order to support multiple physical networks
by mlnx ML2 MechanismDriver.
Due to non merged patches in nova that should support propagating
physical_network retrieved from port binding:profile attribute
to VIF/Network object.
The code will be removed once relevant nova patches are merged.
The code is disabled by default and should be enabled via
ml2_conf_mlnx.ini config file.

Change-Id: I815f9e28774efd47bccd1c57481e6ba89075792b
Closes-bug: #1291209
NEC plugin: Honor Retry-After response from OFC

A backend OpenFlow controller nec plugin talks to can return
503 response with retry-after header when it is busy.
It is better to honor retry-after header to avoid unnecessary
user-visible errors due to temporary busy condition.

Change-Id: I2ff1c3ac8402a2207bd955e9a9bb61e147950c5c
Closes-Bug: #1294527
BigSwitch ML2: Include bound_segment in port

Includes bound segment in port create/update
requests to disambiguate when the parent network
has multiple segments.

Closes-Bug: #1294355
Change-Id: I59ef38aa5de46c1229384e0c4a9f0ee01c1bc678
Sync excutils from oslo

In order to fix undesired error logs in Neutron (bug 1288188)
fixed save_and_reraise_exception() should be synced from oslo.
Oslo commit: 33a2cee6a690ecfdb2cecfe8f01b0b1dacb5bd17

Also sync gettextutils module as excutils depends on it
Latest commit in oslo: fd33d1eaa039913d8c82b94c511a3eab0c3d5789

Closes-Bug: #1294537
Related-Bug: #1288188
Change-Id: I62ab3e4e22aa000f3a8d1be26ef9e1cfb1714959
Merge "Stop removing ip allocations on port delete"
Fixes the Hyper-V agent individual ports metrics

Replaces aggregated metric values with separated values for each port.

Co-Authored-By: Adrian Vladu <avladu@cloudbasesolutions.com>
Change-Id: Ie946dff984ef53f014c6c57f8d1d5bb9c6e7596d
Closes-Bug: #1289007