Apply Oslo ModelBase to NeutronBase

Oslo.db has ModelBase which implements most of NeutronBase's code.
Therefore NeutronBase should inherit from ModelBase to keep things DRY.

Fixes bug #1171055

Change-Id: I1a08636a6aa225da8b5d43a0bbcb9b59c057df42
Improve lbaas haproxy plugin_driver test coverage

 - also removes unnecessary delete_health_monitor() from haproxy plugin_driver

Fixes bug 1191007

Change-Id: Ic9ec1f705a94a2e246d1a4985e72e9c58d48191d
Limit min<=max port check to TCP/UDP in secgroup rule

icmp_type and icmp_code are mapped to port_min_range and port_max_range
respectively. For ICMP there is no constraint between type and code.
Thus port range min<=max check should be enforced only for TCP and UDP.

Also makes sure that ICMP type/code are 0 to 255 (both inclusive).
Previously a value with 0 to 65535 were accepted for ICMP type/code.

Fixes bug 1197760
Fixes bug 1197769

Change-Id: I70aaf6e02fee461fa97dc254db906d9efa173669
Preserve packet:byte counts in iptables_manager.

Ported the nova iptables manager code to neutron, so that we
use iptables-save/restore with the -c flag to save/restore
the chains and rules with their packet:byte counts.  All other
changes were ported as well to keep the code as similar as
possible between the two, although they will be different as
I had to fix other bugs found during testing.

Updated tests accordingly to account for new calls and
input/output changes in formatting.

Changed iptables_firewall code to add iptables rules in the same
order that iptables-save will print them: source/dest, protocol,
sport, dport, target; else iptables_manager won't be able
to find them to preserve their [packet:byte] counts.
Tweaked other rules accordingly as necessary.

Fixed a bug introduced in an earlier version of this patch where
_modify_rules() sometimes wouldn't match an existing rule correctly
if not top=true.

Fixes bug 1125393

Change-Id: I858c552d8a7ae24f52f8e8daa05ac37026705773
Register agent schedulers options in one place

Currently agent schedulers options are defined in neutron.scheduler and
every plugin that supports scheduling should register them individually.
It is reasonable to define and register options in one place - agentschedulers_db.

Fixes NeutronManagerTestCase when running separately by importing missing config option

Fixes bug 1198904

Change-Id: Ia9c1ad3fb4b71796401ef5507f741f3cc024a4da
port-update fails when using SELECT FOR UPDATE lock

In Postgresql, it will throw the bellow exception when
using SELECT FOR UPDATE lock combined with outer join.
"SELECT FOR UPDATE/SHARE cannot be applied to the
 nullable side of an outer join"

The reason can refer http://www.postgresql.org/ \
message-id/21634.1160151923@sss.pgh.pa.us

for this issue, I don't think outer join is necessary，
so I change it to use inner join.

Fixes bug #1191653

Change-Id: Ifc9ecad91324ce28399431ea77fe0865b6d8e523
Add status description field for lbaas objects

Fixes bug 1166925

Change-Id: I44d936afd8cd531a786c09c38bbc4702737ce99c
Add support for the extra route extension in the NVP plugin.

The underlying feature is available in NVP 3.2, which introduces a
new type of router. Therefore, create_lrouter needs to be made
version 'aware'.

This led to a number of fixes in the nvplib, especially around how
version is retrieved and how version-dependent methods are called.

Implements blueprint nvp-extra-route-extension

Change-Id: Ie4e2d93f70e1948a62563c8523aea61bb2194c84
rename quantum into neutron

Bug #1200474

Change-Id: Ib83e58008fc53b57c4063057ce4c5707b55f0ff2
Enable logging before using it

Bug #1200530

Change-Id: I086353c93fae0f6ec74d16a485c215c1b3815ee6
Use the correct tunnel_type to notify agents

Bug #1201274

Change-Id: I9de55d168ba03cb6a5273b4c2ce140cd190e38ee
Merge "Add support for the extra route extension in the NVP plugin."
Imported Translations from Transifex

Change-Id: I241d1c1217fcf32e2d02832db15a9c5ab5da4359
Fix random OverflowError exceptions in gate-neutron-python26 tests

These errors seem to be linked to the NEC plugin and http connections
not being stubbed out correctly. This patch ensures do_request is
stubbed out prior to the tests execution; this should be enough
to prevent timeouts from occurring again. Stubbing out the call has
no effect on the coverage of the agent scheduler tests for the NEC
plugin.

Fixes bug #1201478

Change-Id: Iee3cb3cb3137cedcf97c707ea7fde9114b7264b6
Nicira NVP plugin support for l3_ext_gw_mode extension

Bug 1121129

This patch adds support the 'configurable external gateway' extension
in the NVP plugin.

Change-Id: I531ebe0053b1b9e21d6f0685776acebe3173b170
Ensure PortSecurityDBTestCase loads correct plugin

Bug 1201569

If a plugin is passed to the setUp method, that plugin
should be loaded instead od DB_PLUGIN_KLASS

Change-Id: I81df9f62e7399f5a76a07e504679ee8311e5855e
Re-assign quantum.api module as last operation

Bug 1199443

This avoids reset of locals in quantum/api/__init__.py,
resulting in sys being None when assigning quantum.api.extensions
to neutron.api.extensions

Change-Id: I2da8b336679b643c92824399a05ca1b9980d1598
Merge "Fix random OverflowError exceptions in gate-neutron-python26 tests"
Merge "Preserve packet:byte counts in iptables_manager."
Merge "Re-assign quantum.api module as last operation"