Updates clear_db() to unregister models and close session.

fixes bug 1080988

This change fixes the bug by ensuring the metadata and session objects
are properly cleaned up by clear_db(). Using the proper calls reduces
the memory required by unit tests.

Change-Id: I1d1802b642eff83b7f96211608195afaf68e855a
Improve openvswitch and linuxbridge agents' parsing of mappings

Created generic quantum.utils.parse_mappings function that detects
duplicate key or value strings, and changed openvswitch and
linuxbridge agents to use this to parse their mappings from physical
networks to bridges or interfaces. Fixes bug 1067669.

Also fixed some typos in comments.

Change-Id: I342eaeeb6ff4c6e25d57d631f250faac082011b8
bug 1057844: improve floating-ip association checks

allow multiple floating ips to be associated with the same internal port
as long as they map to different external nets (not yet supported in
Folsom) or different internal fixed IPs.  With Quantum, there is no
need to disallow either scenario.

Also improve check for a valid external network to router to internal
subnet path when a floating IP is bound.

Change-Id: Iced675e1f064172ee8a5bb6b9e37032e83af5711
Part of the patch set that enables VM's to use libvirts bridge type.

Fixes bug 1078210

The patch set enables the following:
1. Bridges to be created by Nova
2. Bridges to be created by the agent

The code is backward compatible, that is, if Nova does not create the brdige
then the agent will create the bridge.

In addition to this it cleans gateway code no longer used.

The patch enables the following Nova code to be backported:
https://review.openstack.org/#/c/14830/

Change-Id: Ia621ba5edd12d8eb7ea412a2993fea43189bd511
Ensure that the expiration time for leased IP is updated correctly

Fixes bug 1081664

Change-Id: I77596ef65be817a874fad41b49e7ddbc0663c237
Merge "bug 1057844: improve floating-ip association checks" into stable/folsom
Merge "Ensure that the expiration time for leased IP is updated correctly" into stable/folsom
Updates tearDown() to release instance objects

This change fixes the bug by releasing the objects of the instance
of class QuantumDbPluginV2TestCase. Removing unnecessary objects
explicitly reduces the memory required by unit tests.

Fixes bug 1065276

Change-Id: Ia003a7718e1aedc4e4c8fb02b723f4a511ebc319
Treat case when pid is None

Fixes bug 1077651

Change-Id: Id80d923d36a0339eee860e8cf37aacc6866fc6bc
Merge "Updates clear_db() to unregister models and close session." into stable/folsom
Merge "Updates tearDown() to release instance objects" into stable/folsom
Make sure we can update when there is no gateway port linked to it

Bug #1083387

Change-Id: I7e56d072a6e430ddde816781fe480c6028577c5f
Use DB count to get resource counts.

Fixes bug 1075369, and includes bugs 1081259, 1083696 which fixed
regression in the original version of this patch and bug 1083180
which improves the documentation of the original patch.

During quota check we used to simply retrieve the entire collection
of resources from the database, then counting them in Python. This
patch introduces a specialized _get_collection_count() method, which
instead take advantage of the DB's built-in count capabilities.

In order to take advantage of this, plugins can now implement
get_*_count() methods for their resources. This is used (if present)
by the quota checking function.

Change-Id: Idc347cfacc363f2cac47356296514fe735625f29
Merge "Part of the patch set that enables VM's to use libvirts bridge type." into stable/folsom
Fixes order of route entries.

Fixes bug 1083238

This patch makes sure that a route entry for dnsmasq is placed first
before any others (for example the l3-agent one). This makes DHCP work
when network namespaces are disabled.

Change-Id: I241a8e30127d614f7582e10d999521f6486e5255
Prevent router being deleted if it is used by a floating IP

Fixes bug 1080638

Change-Id: I10768044aac3fe0ce994e42e798df754478d98d1
fix remap of floating-ip within l3-agent polling interval

bug 1083990

Change-Id: I1bb365fe6accc24a223acd2b31d4eacdb6809410
Final 2012.2.1 versioning

Change-Id: Iedbe1d2f4586f93e27a878a40ce00f65914035a7
Bump next version to 2012.2.2

Change-Id: I2093b070ccadb09f7b17d6219f2a8ce4cb987fd0
Fix rpc control_exchange regression.

A change was made in rpc that requires project's to define the
control_exchange option themselves.  This was so the project's could
set their own default value.  This change has made it in to quantum without
adding the control_exchange option, meaning that it is using the default
of 'openstack', potentially conflicting with other projects.

See https://review.openstack.org/#/c/12518/

Change-Id: Ia551a3e83de5de17ca7a8ce2b41d64d512983c42