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"