RBD store uses common utils for reading file chunks

Prevents cases where the image_size passed to the RBD store is larger
than the actual image_file which attempts to write 0 bytes of data
causing image.write to hang indefinitely.

Fixes LP Bug #1146830

Change-Id: I56216437a212c0c802d2ed349d88b3bd0d3bb4d7
Add qpid-python to test-requires

The qpid notification tests are not run if the qpid-python package
is not installed.  This change adds it to the test-requires list
and removes the check for it since it should always be present.

Fixes bug 1173380

Change-Id: I2763e320e6018fde196c903f515920ad33f28aa6
rbd: return image size when asked

Implement get_size(), and use it for the second part of the return
value of get().

Convert the old-style functional tests into tests using the store test
base class. These test the store api directly, and are more up to date
than the old functional tests that went through the api. The store tests
base class already includes tests for get() and get_size().

Fixes bug 1180565

Change-Id: I85ca0a0ab3155d1a25607ba9dc210be5719bf85c
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: remove extra str() conversions and test with unicode

librbd doesn't handle unicode, so strings passed to it must be plain
ascii. Originally the rbd store did this before each call, but since
3aea9320d20d0291c5b4b027a585370d8e658a95 it only needed to convert to
ascii in StoreLocation and add(). Remove the extraneous calls to
str(), and add a test that uses a unicode image_id and uri to make
sure unicode isn't passed to librbd anywhere.

Change-Id: Ib7656126e044775f516fa6665e28f6d474820665
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Improve unit tests for glance.api.v1 module

Add test for glance.api.v1:
* tests for glance.api.v1.filters.validator
* tests for glance api add member method
* tests for glance api replace member method
* tests for glance api delete member method
* tests for registry api image details method
* tests for registry api image delete method
* tests for registry api add/delete/update/get member methods

Fixes: bug #1152230
Change-Id: I79d06b2281ba0c9b8d10b9300fffe6cc3c69c4ee
Prevent '500' error when using forbidden marker

If an existing image id was used as a marker, but
the user didn't have access to that image a '500'
error occurred. Return '400' instead.

Fixes bug 1178307.

Change-Id: Ib632297d944a19e18694fff154307a3bc6d5b625
Respond with 412 after upload if image was deleted.

When updating the image after upload, we should return an
HTTPPreconditionFailed instead of a 500 error if the image cannot
be found.

This will also provide more information to nova when this occurs
during snapshotting.

Fixes bug 1176174

Change-Id: I270ee129470323dae3919ed0a8c335eae7c24061
Make passing user token to registry configurable

This patch adds CONF.use_user_token as a config option. When true, glance will
continue to use the user token when communicating with glance registry. When
false, glance will read admin credentials from the config and use those to
communicate with glance registry. Using admin credentials allow for
reauthentication when tokens expire and prevents requests from silently failing.

DocImpact
Fixes bug 1182536

Change-Id: Ia6b563677eb67d4069571c82b9dad3f025b6e9fb
Fix undefined variable in cache

A function to verify metadata in the cache middleware was falling over
for GETs on images with a missing size.

Fixes bug 1183049

Change-Id: I2da75e5e5aca12d20a10cace2a3779e4041161b2
Merge "Respond with 412 after upload if image was deleted."
Merge "rbd: return image size when asked"
Merge "rbd: remove extra str() conversions and test with unicode"
Merge "Improve unit tests for glance.api.v1 module"
Merge "RBD store uses common utils for reading file chunks"
Merge "Prevent '500' error when using forbidden marker"
Sync oslo imports to the latest version.

Change-Id: I36193d00930e5c82c46841b64650863c811b95a4
Import strutils from oslo, and convert to it.

The only change of behaviour here (according to the former glance
unit tests) is that 'T' now means True not False. I suspect that's
ok.

Change-Id: Icf98f913a3f78a1fe2f38a82a25a071c2da03739
Add documentation on reserving a Glance image

This lets us refer to the fact that some optional headers are in fact
required unless reserving an image.

Fixes bug 1124224

Change-Id: I5646d4dc130efecf991573b363eb1a665012b7df
Fix pydevd module import error

Introduces a try-except block in 'setup_remote_pydev_debug' that will
handle the pydevd module import error gracefully.

Implements: blueprint pydevd-module-import
Change-Id: Ia25b8ef21266ab52dc11c11e9db0bbfa8542f1b9
Merge "Make passing user token to registry configurable"