Rewrite Swift store functional tests

The existing functional tests for the Swift store depend on
spinning up a full system. We really just want to test that
our store interface is good, so this patch adds tests for
just that.

Prevent swift store from prepending 'http[s]://' to auth url
if it is already there. This should be broken into a different patch.

Running the tests works the same way, just define a local config
with the necessary swift_* options. Set the GLANCE_TEST_SWIFT_CONF
environment variable to the location of that config.

The old full-stack tests have been removed.

Change-Id: I506993ce44354950534443c2101f8417a2a918e0
Separate glance cache client from main client

This is relocating the necessary functionality for the glance
cache management tool into a new client class.

Related to bp separate-client

Change-Id: Ib89db1245aca5032a8d93876e07c562cb1fb5d4d
Fallback to a temp pid file in glance-control

Fixes bug 1046593.

Previously if the pid file was not writeable by the current user
then glance-control bombs out, *after* spawning the required service
but *without* caching the process ID anywhere.

Now we fall back to a temporary file, so that at least user can supply
that file to the corresponding glance-contol stop command.

Change-Id: I6c1daf36221f731fdb5a8bb59d3f91a595337af8
Ensure status of 'queued' image updated on delete

Images in 'queued' status (and those without a location attribute)
were not being updated with a status of 'deleted' when a DELETE
action was taken on them through both the v1 and v2 APIs. This
patch ensures that both APIs correctly update the images.

Fixes bug 1048851.

Change-Id: I9604d4ce5d59066fb108625df0fa114cc044d604
Add s3_store_bucket_url_format config option

Swift's implementation of the S3 interface doesn't support subdomain
access to containers. It requires that the bucket be prepended to the
request path. The option 's3_store_bucket_url_format' can be set to
either 'path' or 'subdomain' (default) to control how boto forms
the bucket url.

Fixes bug 997658

Change-Id: Ia6e1e7356eef7ac2267f7738e2f4a7c70dc12eeb
Merge "Fallback to a temp pid file in glance-control"
Merge "Add s3_store_bucket_url_format config option"
Set new version to open Grizzly development

Set version to 2013.1 on master to open Grizzly development.

Change-Id: Iab3d2fd0c3844504ad545774374d89a32e5ac11c
Update v2.0 API version to CURRENT

The v2.0 API is stable, so we need to communicate this fact to the
consumers of Glance. This updates the status of the v2.0 version
entity in responses from / and those that result in a 300 Multiple
Choices status code from 'EXPERIMENTAL' to 'CURRENT.'

Change-Id: I9e4514025904d7be2e947c6d14ccb90b6b066f8c
Update openstack-common log and setup code

Pull in changes up to commit 95cd3a7fad2d0335c65394379c35a798df9d25b4

Change-Id: I628f15aa6367ab2af7912f1b5324055a0fc3c20a
Merge "Update v2.0 API version to CURRENT"
Merge "Update openstack-common log and setup code"
Merge "Rewrite Swift store functional tests"
Merge "Separate glance cache client from main client"
Add region configuration for swift

Addresses bug 1050034

Change-Id: Ib83f5dbb2c1fbeacd741e0cb92b619e67b2243c7
Add filesystem store driver to new func testing

This also fixes bug 1050098. In order to match the existing functional
store test, the filesystem backend needed to be returning the actual
image size.

Change-Id: If202a52a6d303ca2d07fd3abb7f9ac7fe009690e
Generalize remote image functional test

All backends should be able to read any arbitrary image from
a supported backend. This pulls out swifts test_get_remote_image
test so it can be used by the filesystem tests. In its place is
a new store-specific test helper called stash_image - this should
be implemented for each store test to help store aritrary image
data.

Change-Id: I05317216f21bb52ad1fea107c6192bf9a9f9cae3
Add functional tests for the HTTP store

This spins up a local HTTP server on an arbitrary port that returns
a specific set of image data. The store tests then make the necessary
HTTP request to said server.

Change-Id: I8bdebd3d61073fb909728127083831704fc1dd29
Add unit tests for size_checked_iter

Change-Id: I3822d093571b02b2bb9a7d0b7d6cb4c1a0b9e812
Don't WARN if trying to add a scheme which exists.

Updates the register_scheme_map function in store/location.py so that
it registers new scheme maps only if they don't already exist.
Also, removes the warning message that was previously logged if
a duplicate entry was found. Since both Glance v1 and v2 controllers
attempt to register scheme's this seems reasonable and shouldn't cause
any problems with how things work.

This fixes an issue where Glance API logs always had warning messages
stating it was 'Overwriting scheme' information even though everything
is configured correctly.

Fixes LP Bug #1050711.

Change-Id: Ief539187f9c64a3b2de6d431b1e2ffc9e07e5c90