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: when returning VIP include session_persistence even if None

Closes-Bug: #1231915
Change-Id: I3dc5e17118995fb49dd381d08c9d92cb60b80abb
Remove deprecated fields in keystone auth middleware

This commit makes the following changes:

Use X_PROJECT_ID instead of X_TENANT_ID:
  In the latest keystone auth_token middleware it is recommended to
  use X_PROJECT_ID instead of X_TENANT_ID. X_PROJECT_ID is supported
  in auth_token middleware for both keystone v2 and v3 API.
  The corresponding change was done in keystoneclient before Grizzly
  release, so we don't need to take care of X_TENANT_ID now.

USE X_ROLES instead of X_ROLE:
  X_ROLES is now recommended.
  X_ROLE exists just for diablo backward compatibility.

Remove X_TENANT and X_USER:
  X_TENANT and X_USER are for diablo backward compatibility.
  We no longer need take care of them in Icehouse Neutron.

Change-Id: Ie714b1323ff8c44dbee66b54e683226cf675b104
Closes-Bug: #1242447
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
Fix import log_handler error with publish_errors set

Sync from Olso.
Commit Id is Ibf28ba17f81b5ddeda653f6a3501ecac18ffcd42

This handler sends all error logs as rpc notifications.
Note: when using publish_errors you also need to set the
notification_driver option too.

Closes-bug: #1240349
Change-Id: Ie66b23af8da2e439e0ac2f5677f6a064e3dd3133
Refactor configuring of floating ips on a router

This approach to configuring floating ips is stateless and idempotent.
This allows it to handle corner cases, such as reusing a floating ip
address with a different floating ip id in a way that is easier to
understand.

The concept is to wipe the floating ips clean and rebuild them each
time with the following optimizations.  To avoid bad performance in
manipulating iptables, it is called in the context of a call to
defer_apply_on.  To avoid a disruption in network flow a set
difference is use to determine the set of addresses that no longer
belong on the inteface rather than removing them all blindly.

Change-Id: I98aacbbb52b35688036990961d02e0b273504a77
Fixes: Bug #1209011
remove repeated network type definition in cisco plugin

Fixes-bug: #1248374

Change-Id: I912f9cfc140b9a7ac6369526cc623865cf280313
Cleanup HACKING.rst

* Point to new location for hacking doc
(http://docs.openstack.org/developer/hacking/)
* Remove openstack-common section because already in main hacking doc

Change-Id: I7fbcfe13469a75fed08700ccbe07fefbee33db22
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
Replace a non-existing exception

Closes-Bug: #1242662

Change-Id: Ie44023c0fd9ba1373ec6e62d9245884b9f719b7e
Do not run "ovs-ofctl add-flow" with an invalid in_port

Since ofport is a string, we have to convert it to integer to
check it expresses a negative number or not.

Also unit tests are added/corrected.

Change-Id: If85595f1b8ecb40ea41edda52706fb1bd41cb1ab
Related-Bug: 1238445
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
Arista ML2 mech driver cleanup and integration with portbindings

fixes bug: 1215097

This patch addresses minor cleanups which are the diff between the
original version of the patch which was merged into havana master
branch and the patch that is submitted for merge into stable/havana.

The original patch that was merged into havana master branch is at:
https://review.openstack.org/#/c/49086/
The new patch which has been submitted as havana-backport-potential is:
https://review.openstack.org/#/c/54447/

This whole excercise came into play because the original patch was not
picked up in havana-rc2 because of missing tag in the bug. Therefore, the
need to submit new patch against stable/havana.

When the new patch was submitted for havana-backport-potential, few very
minor previously commented cleanups were incorporated as well. This
patch brings these minor cleanups into master branch as well. Therefore,
merge of these two patches will bring both master branch and
stable/havana at parity.

Change-Id: I4ec5273c26a27ca52b430a6c7485a44e880a1787
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
Removes unused nvp plugin config param

nvp_cluster_uuid is no longer used; it was missed
during the configuration file tweaks that was done
during Havana.

Change-Id: Id6dd684833c99453cd97d88584be04d99fd21550
Closes-bug: #1251086