Improve ODL ML2 Exception Handling

Raise a MechanismDriverError when authentication with ODL fails.
Re-raise HTTPError in "sync_resources" for exceptions whose status code is not 404.

Closes-Bug: #1311758
Change-Id: I99d2c4f270007c369024525ba4e6188d232a0b13
Unit test cases for quota_db.py

This commit adds unit test cases with 100% coverage for the quotas
database implementation in neutron/db/quota_db.py

Closes-Bug: #1312310

Change-Id: Icc08132369e88a2f83fe57f524232e94ec4db702
Performance improvement of router routes operations

This patch fixes inefficiency of updating extra routes.
* remove the code repeated by every routes in validation check.
* remove searching a record to delete per record.

Note: Unit tests are covered by existing ones. So no unit test added.

Change-Id: Ia335ac21c65148063d330e4533a15a73962c43d8
Closes-bug: #1312482
NSX: pass the right argument during metadata setup

The NSX cluster was erroneously passed instead of context.
This patch addressed that and tweaks UT to verify the right
parameter is passed instead.

Change-Id: Ife660b3a23705342043d121c7dcecad43e22abc1
Closes-bug: #1315538
Adding tenant-id while creating Radware ADC service

Adding tenant_id as a parameter when creating Radware ADC service

Changing unit tests to test the udated REST call resource
with tenant as a parameter

Change-Id: I7a3e9bfb492e847195031bb72ef15dae8769e91f
Closes-Bug: #1315815
Allow DHCPv6 solicit from VM

DHCPv6 solicit UDP package is currently dropped because
there is no security group rule to allow it like IPv4.

This fix allows UDP DHCPv6 solicit from client port 546 to
server port 547. This fix also drops DHCP reply from VM.

Change-Id: I4941d401576e2c8bad37859d2cba227afde9e764
Closes-Bug: 1316515
Perform policy checks only once on list responses

The policy engine is currently being called for every attribute
of every resource to be returned by a list response. This is
harming the API performance; moreover such a high number of checks
is also unnecessary.

This patch therefore slightly changes the API logic so that list
response first determine the list of attributes which should be
returned querying the policy engine and then use this list for
all resource items to be returned.

To this aim a few methods in base.py needed to be refactored.
This patch also removes the routine check_if_exists from policy.py
and the related PolicyNotFound exception.

Finally, this patch also removes unnecessary admin_or_owner rules
when applied to attributes. This kind of rule indeed has no effect
anyway because of Neutron's ownership checks. The rules were removed
because this change won't allow anymore for having attribute-level
policies whose evaluation result depends on the resource value.

Implements blueprint faster-list-responses

Change-Id: I21b8273add5d5984f512ad94af5a99cf0b0a5d93
Upgrade failure for DB2 at ml2_binding_vif_details

50d5ba354c23_ml2_binding_vif_details fails during upgrade
when DB2 is used as the DB backend of neutron because
Boolean type is not supported by DB2.

This fix uses "1" instead of "true" in sql when db2 is engine.
This fix also changes context creation to op.execute.

Change-Id: I82d2141007894342c634f2c5e62344e20d876d8f
Closes-Bug: 1311589
OVS lib defer apply doesn't handle concurrency

The OVS lib deferred apply methods use a dict to save flows to add,
modify or delete when deffered apply is switched off.
If another thread adds, modifies or deletes flows on that dict during
another process called deffered_apply_off, its flows could be ignored.

This fix stash reference flows list and point the flows list to a new
cleared flows list. Then, it applies flows from the stashed flows list.

Closes-bug: #1263866
Change-Id: Ia3c6ce181e1599d1474da7eb944feff7d84f1d73
LBaaS VIP doesn't work after delete and re-add

When delete and re-add the same vip, we need to send gratuitous ARP
to flush the ARP cache in the Router.

Change-Id: Id97088abb95f4433a100abdae8c8726b3be42ed2
Closes-Bug: 1301165
Merge "Allow DHCPv6 solicit from VM"
Imported Translations from Transifex

Change-Id: Id03cc0a2d92654f617cd99465f81c5523a016c96
Fix issubclass() hook behavior in PluginInterface

Currently, PluginInterface provides an issubclass() hook that returns
True for issubclass(A, B) call, if all abstract methods of B (stored
in B.__abstractmethods__) can be found in the A.__mro__ tuple of
classes. But there is an edge case, when B doesn't have any abstract
methods, which leads to issubclass(A, B) call returning True even if
A and B are not related all.

E.g. issubclass(NeutronPluginPLUMgridV2, NsxPlugin) returns True,
while these two are different core plugins. And it gets even more
trickier when superclasses are involved: e.g. SecurityGroupDbMixin is
a superclass of NsxPlugin, so depending on the fact whether the
python module with NsxPlugin class is imported or not,
issubclass(NeutronPluginPLUMgridV2, SecurityGroupDbMixin) will return
either False or True accordingly.

Closes-Bug: #1308489

Change-Id: I92711a00a19b89729ccdba9cbd8a2e7a2d2868ed
Merge "NSX: pass the right argument during metadata setup"
Corrected the syntax of port_update call to NVSD agent

The parameters passed to the agent rpc port_update call in
NVSD plugin were wrong. It is corrected now.

Change-Id: I9ec8f74695b6ca813ffad9e33502d9a2e0bd1f92
Closes-Bug: 1318909
Merge "Upgrade failure for DB2 at ml2_binding_vif_details"
Merge "Perform policy checks only once on list responses"
Merge "Improve ODL ML2 Exception Handling"
Ensure tenant owns devices when creating a gateway

This patch adds an ownership check in the create_gateway method.
This kind of check can hardly be enforced leveraging the policy engine.

Change-Id: Iffdc9c570d688f824374281b37efd23761883d26
Closes-Bug: 1319583
Add mailmap entry

Add mailmap entry for my email address

Change-Id: Ia46c28c86ef3f440556b1b027d2bf0a7f3e721c5