Fix unshortened IPv6 address caused DHCP crash

When unshortened IPv6 address provided to allocation pool, DHCP
agent crashed because OpenStack is trying to add same IPv6 addresses
to dhcp tap device.

The root cause is that current code compares provided unshortened
IPv6 address with the returned result of "ip addr list", which is
shortened. So the same IPv6 address is treated as different ones.

The fix is trying to shorten the provided address before comparison.

Change-Id: If1e183e65c5ab785b73771d9a3d4b525d38284a9
Closes-Bug: 1266780
Remove unused variable

o neutron/services/firewall/drivers/linux/iptables_fwaas.py:FWAAS_CHAIN
  = 'fwaas'

  This variable was added in the following commit.

    commit 7e487160867d2c2059d556d0d3af50bc8e8838fa
    Author: Rajesh Mohan <rajesh.mlists@gmail.com>
    Date:   Fri Jun 21 17:55:08 2013 -0700

        Firewall as a Service (FWaaS) Iptables Driver

  But there is no evidence that was used.

Change-Id: I5633e74e2441b71e3dddaa0c2f6a5804778e21e1
Delete disassociated floating ips on external network deletion

Also remove redundant check for network in use in bigswitch plugin

Closes-Bug: #1238439
Closes-Bug: #1259144

Change-Id: I7586f43c2e99be9df491c68bf1e8658994ffd263
Remove RPC to plugin when dhcp sets default route

_set_default_route() was using an RPC to the plugin to get the DHCP
port for the network on the current host, and then used it to form
the tap device name. This happened on every allocation reload too.
This fix removes the RPC and gets the tap device name using local
methods instead. It also removes an unnecessary call to set the
default route in the restart method.

Closes-Bug: 1290068
Related-Bug: 1294254
Change-Id: I639bcf93725c4969d1011d2d20491d461ccfdbed
Enable flake8 E711 and E712 checking

E711 comparison to False should be 'if cond is False:' or 'if not cond:'
     comparison to None should be 'if cond is None:' or 'if not cond:'
E712 comparison to True should be 'if cond is True:' or 'if cond:'

Most violations were in DB queries. Replace as follows:
  False -> sqlalchemy.sql.false()
  None  -> sqlalchemy.sql.null()
  True  -> sqlalchemy.sql.true()

Change-Id: Iff54747b70f504d5466cfdc6e2ec4d7a0f9ddb7c
Closes-bug: #1305377
Exclude .ropeproject from flake8 checks

Change-Id: Ic788c49e5e92b171e20fe132829648ff21539e33
Closes-Bug: #1297016
Fix Metering doesn't respect the l3 agent binding

This patch fix the issue by changing the call to
find the plugin which handles the l3 which is now
the l3_router service plugin instead of the old mixin.

Also change the unit tests to use the l3 service plugin
instead of the l3 mixin and refactor the rpc callbacks
part.

Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
Closes-bug: #1257354
Change-Id: Ide26f825005fa63cd3fcc75fa91fffb947e0be7a
Check if bridge exists and make sure it's UP in ensure_bridge

Introduce _bridge_exists_and_ensure_up that checks if the bridge
exists and if it's DOWN sets it UP

Change-Id: Ide9d2bb04016cadb347b00cadbee7007e61bd01e
Closes-bug: #1282741
OFAgent: Process port_update notifications in the main agent loop

Port the following patch to OFAgent.
commit: 5e6e592132aa9a98936ce3bfdb66efc7832caafb
https://review.openstack.org/#/c/61964/

Partial-Bug: 1293265

Change-Id: I53813d12c66dc746cd373fd91ff9bd9bdbf222db
OFAgent: Improve handling of security group updates

Port the following patch to OFAgent.
commit: 3046c4ae22b10f9e4fa83a47bfe089554d4a4681
https://review.openstack.org/#/c/63100/

Partial-Bug: 1293265

Change-Id: Iecdfee894ff2fd5f05f63f040dd70821af124737
Validate IPv6 modes in API when IP version is 4

Add a validation to ipv6_ra_mode and ipv6_address_mode with ip
version. An InvalidInput error is prompted when ipv6_ra_mode
or ipv6_address_mode is specified in subnet create and update
API and ip version is 4.

Change-Id: I9a0356f23e6b162c31f2d289a34f4bd261cee91e
Closes-Bug: 1307788
gw_port should be set as lazy='join'

This forces the object to be ready ahead of accessing time.
The change in loading behavior is also beneficial while listing
routers, as reduces the amount of queries being issued. Tests
show a performance gain of 15-30% for router-list times.

As Mr. Aaron Rosen is used to saying: Woot woot!!

Closes-bug: #1309144

Change-Id: Ibae261b91de26ca7c50e3f6c80e9be2a799785a3
Fix migration that breaks Grenade jobs

Migration 33c3db036fe4_set_length_of_description_field_metering
needs to be changed as it is a reason of Grenade job's fail.

Closes-bug: #1307344

Change-Id: Ia57d9a60847e4a34977e40fb8b09181bdbd9c39b
ML2 Cisco Nexus MD: Improve Unit Test Coverage

Improve unit test coverage for:
neutron/plugins/ml2/drivers/cisco/ modules.

Current coverage info:
neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2      65%
neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver 82%
neutron/plugins/ml2/drivers/cisco/nexus/credentials_v2       81%
neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus     78%
neutron/plugins/ml2/drivers/cisco/nexus/config               75%

With these updates:
neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus     99%
neutron/plugins/ml2/drivers/cisco/nexus/nexus_db_v2          99%
neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2      65%
neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver 98%
neutron/plugins/ml2/drivers/cisco/nexus/config               100%

NB: nexus_models_v2.py consists of database definitions and two
customization methods, __repr__ and __eq__.

Change-Id: I0de1cb9e71adffff698e37c8bec5497b88f0f0cd
Closes-Bug: 1267481
Make help texts more descriptive in Metaplugin

This patch makes help texts of configuration parameters of
metaplugin.ini more descriptive. Comments in metaplugin.ini
are also improved.

Change-Id: I1fac888ecc223a7199cc9c9aeb603b7493f22171
Closes-Bug: #1283930
Updated from global requirements

Change-Id: I11182ae01c05ed104b064c2b68bcbf5a53e0da99
Merge "ML2 Cisco Nexus MD: Improve Unit Test Coverage"
Merge "gw_port should be set as lazy='join'"
Ml2: Set correct nullable for admin_state_up

In migrations 492a106273f8_brocade_ml2_mech_dri was set incorrect
nullable parameter:

Set admin_state_up NOT NULL in ml2_brocadeports.

Partial-Bug: #1296282

Change-Id: I051e37990ae3371978eeb1ff71e70ae2a44097bc
Cisco: Set correct nullable for switch_ip, instance_id, vlan_id

Corrected the following model according to database
content:
 - NOT NULL for NexusPortBinding switch_ip and instance_id

In migrations folsom_initial was set incorrect nullable parameter:
- Set vlan_id NOT NULL in cisco_nexusport_bindings.

Partial-Bug: #1296282

Change-Id: Ie5315fcbf227025c30ab4a4b97ec2a140ee3923c