Remove start index 0 in range()

Remove the useless arg ("start index" = 0) in files, since its default
value is 0, to make code cleaner.

Fixes bug #1259560

Change-Id: Id595630f97b21cc84aefc39b31e7f09f5fb8deb9
Update common network type consts to same origin

This patch removes new definitions of common network type constants (TYPE_FLAT,
TYPE_LOCAL, etc.) and modifies uses of aforementioned constants to a common
place where constants are defined (neutron.plugins.common.constants). This
patch does not change values that are equal in value but different in name:
NETWORK_TYPE_FLAT vs TYPE_FLAT. A second changeset will be made to handle that
case.

Unit tests were modified as well when they referred to the constant.

Finally, the ovs agent code refers to the OVS plugin constants directly and
these had to be changed as well. A TODO flag was put in that file due to use
of another plugin specific constant.

Network types that were only defined in a single plugin, such as mellanox's
infiniband (IB) network type was not carried over to the common constants file.

Fixes-bug: #1196170

Change-Id: Ib6bfc8275496a24bf247946d177c734b62ae44bb
fix --excluded of meter-label-rule-create is not working

rule['excluded'] is boolean type, should not be compared with 'true'

Closes-Bug: #1248002
Change-Id: Ie78c307ede1f7124c58354825a411474ff6c1234
Do not trigger agent notification if bindings do not change

The method _process_port_bindings for the ml2 plugin should not
return True when the host binding does not change, otherwise an
unnecessary notification will be sent to the agent

Closes-Bug: #1255680
Related-Bug: #1253896
Partially Implements: neutron-tempest-parallel

Change-Id: I8a40090af347ca430ff6c8e2211fa34bb2bd0f8c
NVP plugin: Avoid timeouts if creating routers in parallel

There is a well-known issue of eventlet causing deadlocks with
mysql transactions; such condition might occur when
creating NVP routers in parallel.

To avoid this, this patch moves the long-running method
_update_router_gw_info outside of the mysql transaction, adding
the appropriate failure management code, and adds a lock to the
method _nvp_create_ext_gw_port, to ensure serial access to it.

Unit tests for verifying correct behaviour in case of failures
are added as well.

Closes Bug: #1251847

Change-Id: I2864e2f5bfd3982875ef9df97186f64a9fcaa0e0
extra_dhcp_opt add checks for empty strings

When passing extra-dhcp-opt into the port-create where an empty string
is provided as opt_value='   ', the create and update routine will load the
empty string into the DB. The result when written to the opts file is:
"tag:ece4c8aa-15c9-4f6b-8c42-7d4e285734bf,option:server-ip-address", which
when read by dnsmasq has been tested to cause dnsmasq to segment fault.

Change-Id: I31de4a3d27092bb219d20221c5ef5a6b22e050dc
Closes-Bug: #1257467
Include lswitch id in NSX plugin port mappings

This patch adds the logical switch identifier in the model class
for describing mappings between neutron and nsx switch ports.
This will allow for a better handling of the chained logical switch
use case.

This patch also moves the routines for retrieving nsx identifiers
in a separate module in preparation for the introduction of async
operations and renames relevant model classes, attributes, and
functions from 'nvp' to 'nsx'.

Related to blueprint nvp-async-backend-communication
Related to blueprint nicira-plugin-renaming

Change-Id: I5fa1e8f0d863b7d1fc278ffdeac8acc076a843e8
Imported Translations from Transifex

Change-Id: I2b76e7d72593ce2ae6b1299257a917f01d8788ea
NVP: propagate net-gw update to backend

When a network gateway's name is updated, propagate the
update to the backend.

Closes-Bug: #1261334
Change-Id: Icaae84e7f5373946e8c82e0e519528409925dd9d
Merge "Update common network type consts to same origin"
ml2: gre, vxlan type driver can leak segment_id

When multiple region of segment_id is specified, segment_id can leak
(will be never reused) on deletion of network.

Change-Id: Ia27b7e2c0ff4ab58be304e54123a679a5e35ab00
Closes-Bug: #1260262
Merge "Imported Translations from Transifex"
ml2/type_gre: Adds missing clear_db to test_type_gre.py

GreTypeTest.setUp() in test_type_gre.py should have
self.addCleanup(db.clear_db). This patch adds it.

Change-Id: I1f2ac5d2cae47812591fc5b50099053a4ad9ba85
Closes-Bug: #1261593
Merge "NVP plugin: Avoid timeouts if creating routers in parallel"
Merge "Include lswitch id in NSX plugin port mappings"
Merge "NVP: propagate net-gw update to backend"
Imported Translations from Transifex

Change-Id: I769916f88b706074abc5ee0c8bc6806d26af09f0
Add support for NSX/NVP Metadata services

This is a feature patch (2 of 3) that adds support for
Metadata services provided by the NSX (aka NVP) platform.

It also implements the handling of port events so that
dhcp and metadata configuration in NSX/NVP is updated
if port attributes such as fixed_ips and device_id are
updated.

Partial-implements blueprint nsx-integrated-services

Change-Id: Id2b9125b49c0e15e717605ec6ba3dea5d32ee755
Midonet plugin: Fix source NAT

Source NAT rule was being applied on the incorrect port.
It was being applied to the Neutron gateway port, not to
the MidoNet tenant / provider router link port.

Change-Id: Ib818c09adfb6957b7cad4523e5ce1fdffde9590b
Closes-Bug: #1261665
Change default eswitchd port to avoid conflict

Previous default for eswitch/daemon_endpoint would set a TCP port (5001)
which is in the range of the well known ports.
Change to unreserved port (60001) will avoid that conflict.

Change-Id: I711c4659f497e44a6041ec9958835c1f2f4174a7
Closes-Bug: #1245885