Correct handling mock.patch.stop method

Correct calling the right stop method of mock.patch object.

Change-Id: I53cffd78f7597a9a0dc8ec7dbc176d958c85be83
fixes test_kill_pids_in_file conflicts

Fixes Bug: #1231246
Change-Id: Ibedd59d6570cd8d5020e99125c6808d5d2170851
LBaaS UT: use constants vs magic numbers for http error codes

Closes-Bug: #1245388
Change-Id: I4192b577182891f6d777a5a5eac237c9961e41bb
Use correct device_manager member in dhcp driver

* The DHCP driver used to use device_delegate, but that has
  changed to device_manager. referencing device_delegate
  caused the cleanup of the dhcp agent namespaces to fail.
  This fixes the issue by using the correct member name,
  device_manager

Change-Id: Iab8ea0549383335ff66f3f13df1953d206eeb28f
Closes-Bug: #1245408
remove repeated network type definition in cisco plugin

Fixes-bug: #1248374

Change-Id: I912f9cfc140b9a7ac6369526cc623865cf280313
Fix random unit-test failure for NVP advanced plugin

Two problems were observed:
1. Tasks are not scheduled as desired in greenthread. The fix is to
   increase the max status probing time from 1 second to 10 seconds.
2. An error message is show in unit-test log output. Turns out in
   addition to a bug that may cause task manager stop prematurely,
   another unit-test case test_vcns_driver can cause same error
   message being displayed in the log.

Change-Id: I697dd8fc509308108ff1f40400f36ac6271bf4bb
Close-Bug: 1245698
Linux device name can have '@' or ':' characters

It's possible to set '@' or ':' character in Linux device name. But
Neutron IP lib doesn't handle correctly these names.

To distinguish VLAN devices from others devices with '@' in their name,
the details option in iproute2 is used.

Change-Id: I7ed24ec00f481207d97bdef052f86388f24d9b21
Closes-Bug: #1245799
Fix sqlalchemy DateTime type usage

In migration f9263d6df56_remove_dhcp_lease there is mistake in
DateTime type usage for mysql, used sa.DATETIME() instead of
sa.DateTime()

Closes-Bug: #1250405

Change-Id: I41fcd3babc64e3307895a92f03c7417577fa7b1d
Fix downgrade in migration

Fixes a downgrade bug caused by a portprofile_bindings table
definition mismatch between 2a6d0b51f4bb_cisco_plugin_cleanup
and the initial definition.

Change-Id: I051e5b41a4285b6cf24270ea6229b1bbca42106d
Closes-Bug: #1250454
Fix MeteringLabel model to not clear router's tenant id on deletion

foreign_keys parameter of orm.relationship should point to local columns.
Currently for MeteringLabel it points to Router.tenant_id column which causes
routers tenant_id clearing on label deletion.

Closes-Bug: #1249188
Change-Id: Iccc0daf4f6edd537fd7f9e4b2fc4be094543ca5d
Midonet to support port association at floating IP creation

The Midonet plugin currently does not support associating floating IPs with
ports at floating IP creation time. This bug is created to add this support.

Change-Id: Ie57ebffa5185f26138c04b9836067417c6dc1388
Closes-Bug: #1249957
Adds delete of a extra_dhcp_opt on a port

Add support for delete of extra_dhcp_opt(s) on a port. Where
[{'opt_name': 'opt_to_delete', 'opt_value': None}].

Closes-Bug: #1228008

Change-Id: I75baeff91575cac6546fe2cc6fcf7a0d8e92853f
Fix downgrade in migration

In 63afba73813_ovs_tunnelendpoints_id_unique migration mistake in
usage drop_constraint parameter type_ and positional agruments name
and table_name.

Closes-Bug: #1243073

Change-Id: I60cd6e7f18b193b71f8f20759251b9f59a79965a
Add support for NSX/NVP DHCP services

This is a feature patch (1 of 3) that adds support for DHCP
services provided by the NSX (aka NVP) platform. Green-field
deployments can use the AGENTLESS mode, which will make the
core plugin interact solely with the NSX platform to provide
DHCP services. Support for metadata proxy services, migration
for brown field deployments will be added in future patches.

Partial-implements blueprint nsx-integrated-services

Change-Id: Idfc4b2d871e70cd557d8e0e6b23e5563f9ed3420
NVP plugin:fix connectivity to fip from internal nw

The current set of NAT rules configured in the NVP logical router
prevents instances on an internal network from establishing TCP
connections with a floating IP associate with an internal port
on the same Neutron network.

This patch add a SNAT rule to ensure connections coming from the
internal network always appear to the port associate with the
floating IP as coming from the external network.

Change-Id: I12da12ee136c61fddb04f2b216382b51d751a02c
Closes-Bug: 1221419
Apply six for metaclass

__metaclass__ cannot be used in python3.
six be used in general for python 3 compatibility.

Change-Id: Ib0d71b9676dc01390679396443575c05975d3b58
Closes-Bug: #1236648
Fix OVS agent reclaims local VLAN

If a port disappears on an OVS agent, the port is removed of the lvm
vif_ports list. And if it's the last port of the network on this agent,
the network local VLAN is reclaim.

Change-Id: I07e03107eb86a84eeb8e4d06f27a1d2fbd7cea57
Closes-Bug: #1252284
MidoNet: Added support for the admin_state_up flag

This commit enhances the port, bridge and router resources with the
admin_state_up flag in the MidoNet plugin.

Implements: blueprint midonet-admin-state
Change-Id: I67f4f9ad4099a05f8161aae79331ebba84f561b8
Catch PortNotFound exception during get_dhcp_port

Close-bug: 1252437

Change-Id: I3a7954b869b4f5b909c806f8e47180e1ba6ba374
Cisco nexus plugin fails to untrunk vlan if other hosts using vlan

Closes-Bug: #1246080

Without this fix, if two or more compute hosts have
instances which are
sharing a given VLAN on a Nexus switch, and then
all instances on one of the hosts which are using that
VLAN are terminated, while instances which are using
that VLAN on other hosts remain active, then
the VLAN is not being untrunked from the
corresponding interface on the Nexus switch as
expected.

This fix changes the VLAN removal logic from:
----If this the last instance using this VLAN on this switch:
--------untrunk the vlan from the switch interface
--------delete the VLAN from the switch
To:
----If this the last instance using this VLAN on this switch interface:
--------untrunk the vlan from the switch interface
--------If this the last instance using this VLAN on this switch:
------------delete the VLAN from the switch

Note that this bug also exists in the Cisco ML2
mechanism driver, but the code which implements
this is being redesigned, so it will be addressed for
the ML2 separately.

Change-Id: Icb1f95d1db4baa56c0f6fd68ce6342bbff27641d