Allow unsharing a network used as gateway/floatingip

If network has ports that connect it as gateway to another network, such
as an external network, or "floating ip" ports it should still be
possible to "unshare" it since these ports represent usage of the
network as an external network, not as a VM data network.

Change-Id: Ic33ae7ac193e4fc9fe06a4cfd579a4aacf0e6354
Closes-bug: #1293184
Fix enums usage for postgres in migrations

For downgrade with postgres it is not enough to just drop_table if
table contains enums. The enums should be removed separately after
deleting the table.

Also, if a migration uses an existing enum then postgresql needs some
specific code to re-use this enum.

Closes-Bug: #1243213

Change-Id: Ie5bb8282f7b289c917679192a0d722eb29b8d30f
Audited attribute for policy update not changing

Updating firewall policy with shared, name or description is not changing the
audited attribute to false. Modified firewall policy update to make audited
to false.

Change-Id: Ic3f3e08190dcdaa8f4ecda729bdb2fdf1bdadc52
Closes-bug: 1327063
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
Configuration agent for Cisco devices

A generic config agent for configuring L3+ services in Cisco devices.

This patch targets specifically configuration of L3 fuctionality,
namely routing, NAT and floatingIPs in Cisco CSR1kv virtual appliance.

Implements blueprint: cisco-config-agent
https://blueprints.launchpad.net/neutron/+spec/cisco-config-agent

Change-Id: Ic887a93480eca0b56049c67e32c98658e3a4427f
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
Make sure that gateway is in CIDR range by default

Git commit c3706fa2 introduced the force_gateway_on_subnet
option that verified that the defined gateway is in the CIDR
range of a newly created or updated subnet. However, the default
value was False for backwards compatability reasons. The default
will change to True and the option will be marked as deprecated.

For IPv6, the gateway must be in the CIDR only if the gateway
is not a link local address.

DocImpact
Change-Id: I04fd1caec6da5dceee3f736b3f91f2468150ba2a
Closes-Bug: #1304181
Use correct section for log message if interface_driver import fails

If import of interface_driver in namespace_driver fails then message for
logger raises exception because of taking interface_driver from haproxy
section while actual interface_driver is in default section.

Closes-Bug: #1350320
Change-Id: Ic1e73c0cdccb2fff02f2adfbad677503c29ba88a
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
Removed configobj from test requirements

This module is not longer used by any code in the tree since
f164a60f15ea042b04b250ffc2001beda4f3e4bc.

Also removed a reference to the module from a README file.

Change-Id: I66c4935cb2e119bc96109416df7116d8c09e24e4
Use storage engine when creating tables in migrations

Although __table_args__ is set correctly in the base model, existing
migration scripts were not generated with the mysql_engine option in
the alembic output, likely due to:

https://bitbucket.org/zzzeek/alembic/issue/110/

This adds the mysql_engine option to each table creation operation.

Change-Id: I990e8d64bcadf2be4e1e319319bc23225123b304
Closes-Bug: #1288358
Fix spelling in get_plugin_interface docstring

Change-Id: I2d0910091184ceb183019778fb1adcc3baf8676d
Fix-DVR Gateway clear doesn't delete csnat port

When a gateway is set to a distributed router,
the router checks for the interfaces associated
with the router and based on the number of
interfaces the router creates "csnat" interface
ports that would be used by the SNAT service in
the Service Node.

When a gateway is cleared, the plugin should
delete the "csnat" interface ports. In the
current code, it is deleting the port and
re-creating the port with a different id.

A check need to be made before it creates a new
port to make sure that the router has a valid
gateway port.

This is a bug and this patch fixes this issue.

Change-Id: I84f1795360b3693a025b5fa3454bf9efc7e503ae
Closes-Bug: #1350089
centralized router is incorrectly scheduled

When agent_mode=dvr only distributed routers should be
scheduled to that agent.  This change fixes this problem
by not allowing centralized routers to be scheduled
to an agent configured with agent_mode=dvr

Closes-bug: 1350667
Change-Id: I34e118535094520f2cee853f39d582a625acde20
Make ML2 ensure_dvr_port_binding more robust

There is a remote chance that this operation may
be prone to DB integrity errors, in case the binding
is attempted on the same port twice.

Ideally getter methods should not create, but this
is a common Neutron (anti)-pattern that would be
difficult to eradicate (at least in a single patch);
so for now let's make this code more defensive.

Related-bug: #1269131
Related-bug: #1335226

Change-Id: Ie6c57fd46f0752839814dbac5b14fae2364f973d
Imported Translations from Transifex

Change-Id: Ic168d306e76c0404184bb3636f51e257749cb8b0
Fix DB Duplicate error when scheduling distributed routers

The error was caused by binding the router to an agent
candidate that was already selected during the scheduling
process.

A DB lookup was also saved by passing the router object
around; this led to a minor style cleanup.

Closes-bug: #1351123

Change-Id: Ib71a0140c8a7fbd5b230609d33487f8adba252e7
Fix spelling mistakes

Change-Id: Idedb39b43bc71db0a7e331cc23535d162177c8b5
Merge "Configuration agent for Cisco devices"