Publish v2 in versions responses

* v2 is EXPERIMENTAL for now, as there is no actual implementation
* Partially implements bp api-2

Change-Id: Ie942c54e0ba294da661de870a95d685a9b8966df
Allow specifying the current version in 'glance-manage version_control'

Fixes bug #966242

The version_control command is a bit useless since you can't actually
specify what version to  use and it defaults to version=0.

Allow the user to specify a version:

  $> glance-manage version_control 9 # set the diablo version

and default to the latest version if none is specified.

Also, allow db_sync to be supplied a version for the case where we're
upgrading an unversioned DB.

Finally, re-work the argument handling in glance-manage to more easily
handle optional args.

The tests are extended to test using db_sync for upgrades and to test
placing an existing database under version control.

Change-Id: I231dc710554198bfd1fdcb82c3c3768963f64bd8
Run version_control after auto-creating the DB

Fixes bug #966241

Currently, we auto-create an unversioned DB. This makes it awkward to
later upgrade it, especially since our 'glance-manage version_control'
command doesn't support retroactively versiioning it.

This is easily avoided by running version_control() after creating the
DB.

Change-Id: I935c06fcbcd3611c65d464850ca05445129f905f
Add support for auth version 2.

Implements version 2 authentication for the Swift backend.
Fixes bug 944946.

Change-Id: I614ad03374a2e31a945f12fb9588947022203f1f
Add MySQLPingListener() back

The use of wrap_db() to catch low-level problems in the connection
pool appears to be incompatible with new versions of sqlalchemy
(0.7.4/precise).  This re-instates the use of a event listener to
catch the error of 'mysql has gone away'.  Keeps the wrapping
logic in place for use before the connection pool has been constructed,
specifically to allow glance to retry its initial database connection on
service startup.

Fixes bug 967887

Change-Id: Ia732377d3404104b8acf7fe4ada164ec7ecf705f
Test coverage for update of image ownership

Assert the expected behaviour occurs for update of image ownership
by admin (success) and non-admin users (fails with 403 Forbidden).

Change-Id: I1895f6a30c3c50526955c2fc131c8c3b0817d365
Reject excessively long image names.

Fixes bug 966240

Image names longer than 255 characters are rejected with 400 BadRequest
on creation or update.

Change-Id: I460ffee547496829cbf198b50bca564978abe7f3
Merge "Add support for auth version 2."
Merge "Reject excessively long image names."
Merge "Allow specifying the current version in 'glance-manage version_control'"
Merge "Run version_control after auto-creating the DB"
Merge "Test coverage for update of image ownership"
Merge "Add MySQLPingListener() back"
rename the right index

fixes bug 953159
This did not affect sqlite and mysql, because those can not rename indexes
and thus used a separate sql file to drop and create the right one.

Change-Id: Iab80a65464a591b732ecce4c00d04df50624e912
Updated RST docs on containers, fewer references to OVF format.

Updated the RST documentation that discusses container formats, since they
aren't really used right now.

Changed some examples from ovf to bare, since in most cases, users just upload
a bare image file.

Change-Id: I844d7827c3de4df6cdddb9b963cc2f236a3e6767
Merge "Publish v2 in versions responses"
Merge "Updated RST docs on containers, fewer references to OVF format."
Compile BigInteger to INTEGER for sqlite

Fixes bug 966243

Ensure BigInteger does not map to BIGINT for an auto-created
sqlite registry DB, as this type is not supported by sqlite.

Change-Id: I61f44fbe50ea406d2d593f8f53cab5da3af2222a
Merge "Compile BigInteger to INTEGER for sqlite"
Defaulted amazon disk & container formats

Fixes bug 972014

Default unset disk/container format to the corresponding container/disk
format, where the latter is an amazon format requiring a strict match.

Change-Id: I147df146940a21c368e95901343f36e1e3b7495b