Analyze re-raised exceptions in Cisco Plugin

Checked all cases of re-raised exceptions. In several cases, the exception
was redundant (re-raising the same exception), so the try block and
exception handling was removed.

In one case, exceptions raised from two sources were re-raised with a
a different exception. Instead of doing this, the original exceptions
were changed and the try block and re-raised exception were removed.

In cases where there were database exceptions that were re-raised as
Neutron exceptions, the traceback was left as-is, since it was more
informative to know the higher level source of the issue.

The same was true for the exception mentioned in the bug, where the
original failure was in the ncclient library parsing the configuration
and it would be more descriptive to know that there was a connection
failure or a config failure, that to know the library method.

bug 1213159

Change-Id: Ie334d2548bf651c61e878bf797adaf8c5880eb86
Embrane Neutron Plugin

Implements blueprint embrane-neutron-plugin

This commit implements the main Embrane plugin, which covers
route and extratoute extensions.

The plugin will rely on existing plugins for leveraging L2 networks,
for now it only supports OpenVSwitch and vlan networks, but more
supports are to come if the model is approved (or a different one
is suggested).

Change-Id: I90aff8ec4324bd3a7c59c411374db6a118d1a72b
Add extra_dhcp_opt extension to BigSwitch/Floodlight plugin

Adds support for the DHCP options extenion to the
BigSwitch/Floodlight plugin.

Fixes: bug #1206655
Change-Id: Ida30ca44ecbb9d1208303e47519427a4111f6025
Correct VPNaaS limit checks in extension

For the following VPNaaS attributes, ensure that these validation
tests are performed in the extension:

    keepalive >= 60 (seconds)
    mtu >= 0 (octets)
    DPD interval > 0 (seconds)
    DPD timeout > 0 (seconds)

Currently, the units for keepalive can only be seconds. If this
changes in the future (e.g. to allow kilobytes units), then the
test for the value will need to be changed.

To correctly test the MTU limits for an IPSec connection, the
protocol must be taken into consideration, which is defined by
the vpnservice object. Because of this dependency, we cannot
validate this in the extension, and will instead, just make
sure the value is positive.

Likewise, the attribute validators cannot ensure that the
DPD timeout is greater than the interval (again, because the
validators can only check the individual attributes one at
a time).

The range validator was modified to allow single ended ranges
for some of these attributes. The range also ensures the value
is an integer.

Companion changes are being made in the CLI code for these limit
changes.

Update: Fixed typo causing tox failure.

bug 1216117

Change-Id: I85d6175d81fbe7d27231aed48fb4691351e0db4c
Add missing match in OVS agent tunnel mac leaning

Learned flows introduced in commit a369f9e39691c01a4e4f7f8668cb37fc17ba03b3
to learn remote mac addresses on tunnels currently only match local VLAN,
but not destination mac address, as a consequence, connectivity may be
erratic as soon as more than two agents are used

Change-Id: I467e47d0dd2c1e5aca12a4e240e348116d530d4f
Closes-Bug: #1219074
Merge "Correct VPNaaS limit checks in extension"
Merge "Add missing match in OVS agent tunnel mac leaning"
Merge "Analyze re-raised exceptions in Cisco Plugin"
Merge "Add extra_dhcp_opt extension to BigSwitch/Floodlight plugin"
Refactor BigSwitch error handling to use db rollbacks

This patch adjusts most of the logic handling the
calls to the controller in the BigSwitch/floodlight
plugin to make use of the db rollbacks from
sqlalchemy for free on exceptions. This eliminates
several complex try-except blocks and makes
maintaining db<->controller consistency easier.

Fixes: bug #1215823
Change-Id: Ia636c40e744b3b1c543e891791bf492df4f675d2
Multi-segment and trunk support for the Cisco N1Kv Plugin

This patch adds vlan and vxlan trunk support in the
Cisco N1Kv plugin. It also adds support for multi-segment
networks for bridging vlan networks with vxlan networks.

Change-Id: Ibecbbfbce1eb4d18ef6a1bc5250622b9ae87d39c
Implements: blueprint multi-segment-and-trunk-support-cisco-nexus1000v
Adds metrics collection support in Hyper-V

Blueprint: hyper-v-metrics

Hyper-V Server 2012 supports a new set of metrics API that can be used to
provide switch port metrics data to external applications, e.g. Ceilometer.

Metrics collection is disabled by default and can be enabled with a config
option.

Metrics are configured via ACLs applied by the Hyper-V plugin agent.

Change-Id: Ife2a53db84936bae7c73b8c027022bbc5e89d48a
Fixes formatting exception from logging in BigSwitch plugin

Corrects the data type expected for the HTTP code that comes
back from the back-end controller in a debug log call.

Closes-Bug: #1220521
Change-Id: Ic71b24c724222ade5e695addf291c6488d665da9
Add jump to float-snat chain after clearing snat chain

Clearing the chain in this code eliminates the rule to jump to the
floating-snat chain.  This is the simplest way to get it working
again.

Change-Id: Ic1818e10bd64170b6f0a2f52af8dc0814d7e04e0
Fixes: Bug #1218040
Add Neutron l3 metering agent

This is the agent side of :
blueprint bandwidth-router-measurement
blueprint bandwidth-router-label

This patch initiates agent side by adding a new
l3 metering agent and a Noop Driver.

DocImpact

Change-Id: Ib34721209c282b2669ff5488a33293d9f86467ef
Add method to get iptables traffic counters

Add methods to iptables_manager to get traffic counters.
this is a part of the blueprint bandwidth-router-measurement

Change-Id: I6485d1239085e46398126c81e674e399952a4597
Iptables metering driver

this is a part of the blueprint bandwidth-router-measurement

Change-Id: I37e4dc5abeaca4e13b32155bb7e2f07883ef9b2d
Make ipsec_site_connection dpd_timeout == dpd_interval return 400

dpd_timeout == dpd_interval is a invalid case,
so in this commit, we modify validation and added test.
Fixes bug 1219440

Change-Id: I14fb9aa7df890f9c5a27f18f20d7dc1a316b2d79
Fix DHCP agent to work without extra_dhcp_opt extension

With the introduction of extra_dhcp_opt extension, DHCP agent
stopped serving mac adresses when used in conjunction with a
plugin that doesn't support this extension. This fixes the agent
by not assuming that port dict contains extra_dhcp_opt key.

Closes Bug: #1219893

Change-Id: I5bb52f3092f04c5e332b43cb3a04de05edc29cf5
Merge "Adds metrics collection support in Hyper-V"