Define some abstract methods in VpnDriver class

Define the <op>_ipsec_site_connection() methods to ensure any new
service drivers will implement them.

Closes-Bug: 1326793

Change-Id: Idfe67632893592859990db486393a7108362447e
ofagent: Update a comment in port_bound

Change-Id: Ia393f8cbeafe03455b8f75302c71365fcd75a51e
test_l3_plugin: L3AgentDbInteTestCase L3AgentDbSepTestCase fails

L3AgentDbInteTestCase and L3AgentDbSepTestCase fails when they are run
independently without other test case. something like
tox -e py27 neutron.tests.unit.test_l3_plugin
It's because necessary oslo.config options aren't properly initialized
when instantiating service plugin.
Initialize config before instantiating plugin.

Change-Id: Ic6dd28e3caf8b9e3322bf2df99e67adb138cb234
Closes-Bug: #1350252
Replace nullable from primary keys in tz_network_bindings with default

Columns vlan_id and phy_uuid were both nullable and primary keys.
Primary keys cannot be nulls. This situation caused problems in
autogenerating scripts creating always migration that set these columns
to nullable.

Instead of having primary keys nullable this patch creates a default
values.

Change-Id: I04642f6d6ad232997a593bff8ca44f9a7a803ffd
Closes-bug: #1346900
Implement Midonet Juno Network Api calls

This patch is the first in a series of converting the current midonet plugin
code to the new model described in blueprint midonet-plugin-juno. This patch
focuses specifically on the "network" handlers.

This patch also updates the midonet UT to handle the new objects that need
to be mocked with the new model.

Change-Id: I056d698ce2e312527e756ff56c962cff83a6bc04
Partially-Implements: blueprint midonet-plugin-juno
Remove ignored do_request timeout argument

The timeout to the underlying request was always self._request_timeout,
regardless of the value of the do_request(timeout) arg provided.  Both
callers always pass timeout=self._request_timeout anyway, so just remove
this unused/misleading argument.

Change-Id: I911ee986caef8fcf9b97ef622a03856d4351bee0
l3_db: refactor L3_NAT_DB_mixin

This patch refactors L3_NAT_DB_mixin to split out db operation and
rpc notification.

l3 plugin for routervm will implement the method for REST resource
operation as something like
    def op_resource():
        additional operation
        with session
            additional db operation
            db operation of super class => super().db_op_resoruce
            additional db operation
        additional operation
        l3 rpc notification

However, The current L3_NAT_DB_mixin intermixes db operations with l3 rpc.
So it is difficult to reuse the db operation code without l3 rpc.
This patch splits db operation from l3 rpc notification so that
db operation logic can be reused easily. Thus the l3 plugin for routervm
will be simplified with this patch.

Related to blueprint cisco-routing-service-vm
Related to blueprint l3-plugin-brocade-vyatta-vrouter

Change-Id: I88f6574f921596426e1a31c9ff2251aa6f4674b8
Proper validation for inserting firewall rule

Say rule r2 is associated with policy p2. If user tries to insert rule r1
into a policy p1 before/after r2, error should be thrown saying that rule
r2 is not associated with policy p1.

Change-Id: Ifa415acc9533b7a323f966ee42d476460e68c9d3
Closes-bug: 1330898
Return 403 instead of 404 on attr policy failures

Return an HTTP Forbidden code (403) instead of an
HTTP Not Found code (404) if a tenant is trying to
update it's own object. This is a safe adjustment
since the tenant already knows this object exists
so pretending it doesn't isn't improving secuirty
as much as it is causing confusion.

Closes-Bug: #1352907
Change-Id: I021ba6f890dfbabddd53e75c63083f5da0ecfdec
ofagent: Add a missing normalized_port_name

Otherwise port_unbound can not find Port for non "tap" prefixed ports.

Closes-Bug: #1349898
Change-Id: I9ac7cc1e35205bddc64e7865c45e801df8cd6b33
Remove duplicated check for router connect to external net

In the function get_assoc_data, we check the router which get
from _get_router_for_floatingip whether connect to external net,
but as it has already checked in _get_router_for_floatingip.

Change-Id: I0c00c480273145538d19569dc0a679e9935ad8f9
Closes-bug: #1353414
Fix to enable L2pop to serve DVR

This change fixes the information used by the L2pop
driver to populate l2pop rules that enables DVR to
route packets across compute servers that have
tenant VMs that belong to different networks.
It also fixes the case where VMs were not able to
obtain IP Addresses when such VMs are on DVR
hosted subnets.

Change-Id: Ib630e57c186da60eb15f9ffa6b1b0bfa74f48caa
Closes-Bug: #1350485
Closes-Bug: #1352857
Enabled Cisco ML2 driver to use new upstream ncclient

The code is still able to handle the old, custom ncclient that
we used before. It uses the different function signatures
for the ncclient's connect() function to detect which version
is installed.

Change-Id: I09d81b424d86f4cd35ca048507f06471246b91d8
Closes-Bug: 1352635
DeferredBridge to allow add_tunnel_port passthru

The DeferredBridge should allow add_tunnel_port
method as passthrough in addition to add_port
and delete_port. L2Pop uses add_tunnel_port to
dynamically establish tunnel endpoints on cloud
nodes.

Closes-Bug: #1353885

Change-Id: I2e6d82ee79814e500604f4951e7d89eab662047a
Do not assume order of pci slot list

This fixes the neutron.tests.unit.sriovnicagent.test_eswitch_manager
.TestEmbSwitch.test_get_pci_list unit test that breaks with a
randomized PYTHONHASHSEED (see the bug report).

The test assumed that the pci slot list was sorted, so sort
the result before comparing.

Note: There are several other unrelated unit tests that also break with a
randomized PYTHONHASHSEED, but they are not addressed here. They will be
addressed in separate patches.

Change-Id: Ia2d879cc1251fb9cf9b653a41064e902b30005af
Partial-bug: #1348818
Improve external gateway update handling

Once gateway is set, external_gateway_added() was getting called every time
 a router update was received. The check for change in external
gateway compared previously cached copy of gateway port (ri.ex_gw_port) with
 the one passed in through update router (ri.router['gw_port']).
The cached copy was already being modified by code so the two values would
always appear to be different.
Making the change to compare correctly and remove actions not required
for gateway update.

Change-Id: I1a703b327e6c569dfaa8263a222e4bc797e5dbfd
Closes-Bug: 1348737
Merge "Fix to enable L2pop to serve DVR"
Merge "Do not assume order of pci slot list"
Merge "Return 403 instead of 404 on attr policy failures"
Fix to throw correct error code for bad attribute

Currently the neutron network API throws up error code 500 for
the extended attribute for segmentation id. This can be reproduced
if the user types in a random string in place of an integer value
for the segmentation id. The proper behavior should throw an error
code 400 with the appropriate failure message. This patch fixes the
same issue and covers it with a test case.

Change-Id: I4735e20f5b8b23c5b2a9d896415c2e84561a279c
Closes-bug: #1348056