Remove bad error message in glance-cache-manage

The error message covering unauthorized requests implies that the
caller hasn't set the appropriate authentication values. What
is more likely is that the values are set but the user just
doesn't have permission to use the tool.

Change-Id: I95f4c1b6fc650b6bf8c11a4e343e1b54c14310f9
Fix cache not handling backend failures

1) caching_iter doesn't handle backend exceptions:

caching_iter assumes any exception that occurs is the result of being
unable to cache.  Hence the IOError raised from size_checked_iter, which
indicates a problem with the backend, means the caching_iter will
continuing trying to serve non-existent data.  The exception was not
been re-raised in this case, making wsgi keep the connection open and
clients stuck forever waiting for more data.

Raising a GlanceException in size_checked_iter rather than an IOError
allows caching_iter to distinguish between a problem fetching data, and
a problem writing to the cache.

2) Checksum verification happens after cache commit rather than before:

This block was outside the context manager block which meant the
GlanceException was not caught by open_for_write and the rollback didn't
happen.  This resulted in an error been logged, but the bad image still
placed in and subsequently served from the cache.

Also:

* Fix test_gate_caching_iter_bad_checksum - the loop to consume the
  iterator in was in a subroutine that never got called.

* Move test_gate_caching_iter_(good|bad)_checksum into
  ImageCacheTestCase to excercise both the sql and xattr drivers.

* Remove invalid registry_host/registry_port params from
  TestImageCacheXattr/TestImageCacheSqlite setup which caused a failure
  when testing the file on it's own using nosetests.

Fixes bug 1045792

Change-Id: I8aedec347e7f50566c44c5b6c6db424573c5ebaf
Exception Handling for image upload in v2

Adds logging and exception handling for image data controller
in glance v2

Fixes bug 1037979

Change-Id: Ieba0b9766d7c205e361a3d9a9618300af815beb5
Sync latest cfg changes from openstack-common

Syncs the following changes from stable/folsom:

 4dc2043 cfg: clean up None value handling
 513bd3a Allow set_default and set_override to use None
 0a36c92 Tilde expansion for --config-file and --config-dir
 038d597 Add import_opt() method to ConfigOpts

Change-Id: I615cdbd6dc7c3ec0218252c202f24c2a2d3aa387
Sync some misc changes from openstack-common

Syncs the following from stable/folsom:

 5a56539 Allow non-string items in the creds dict.
 769ec65 Don't trap then re-raise ImportError.
 202b8b7 Fix spelling typos
 6a22ea4 Remove unused imports
 01b4f31 Support for marshalling datetime while preserving microseconds.

Change-Id: I31aba154fb1743b771ca9c1d4befa5ee563ca20c
Call do_start correctly in glance-control reload

* Rename test_respawn functional test module to test_bin_glance_control
* Add 'reload' and 'reload_server' calls to functional test helpers

Fixes bug 1044119

Change-Id: Ide63fdb9f78cd4d6a1cdb7b9f37a10694a7dddd3
Sort UUID lists in test_image_get_all_owned

Ensure UUID list comparison is order-independent, to avoid spurious
failure from the test_image_get_all_owned test case.

Change-Id: I78743a65978b2f1c10adb66b7128c9f438393796
Merge "Sync some misc changes from openstack-common"
Merge "Fix cache not handling backend failures"
Merge "Sort UUID lists in test_image_get_all_owned"
Merge "Call do_start correctly in glance-control reload"
Merge "Remove bad error message in glance-cache-manage"
Merge "Exception Handling for image upload in v2"
Asynchronously copy from external image source

Fixes bug 1008874, bug 1046433.

Avoid tieing up dispatch thread for large copy-from images,
instead initiate copy asynchronously.

The response status is not set to 202 Accepted as per standard
RESTful idiom, as a non-error response code change requires
an API version bump.

Instead, the incomplete nature of the image registration is
reflected in the image status.

Change-Id: I06692422490de0a7d93f63bbd0ffb9c6435a0d2b
Makes deployed APIs configurable

Uses config options enable_v1_api and enable_v2_api
to control which APIs have been deployed.
(Thanks markwash for all the help)

Fixes bug 1043497

Change-Id: I42dc1d88f94e61b9550c5f114ffc1abad25be7ff
Remove db auto-creation magic from glance-manage

This removes the reliance of glance-manage db_sync on configure_db
calling register_models.

Fixes bug 1042925

Change-Id: Id93283905256247bdd2663b799d41a7925804542
Merge "Remove db auto-creation magic from glance-manage"
Remove extraneous whitespace in config files

One can not simply remove the hash mark in front of a commented-out
config option if there is a space following it. This patch removes
that extraneous whitespace.

Change-Id: Id084eef34a9e894de3f67b2919d55879cd9a715e
Handle multi-process SIGHUP correctly

Child processes were returning to the main while loop
and spawning a next generation of processes. Instead
they should exit cleanly.

Fix for bug 1042823.

Change-Id: I8c0d150640c78487b43279a44d0d6d3ac3e386cc
Merge "Asynchronously copy from external image source"