Improve test/utils.py

Introduce new class into utils.py to keep glance api tests DRYer

Partially implements blueprint glance-tests-code-duplication

Change-Id: Ic77961fcc83806fd451afa1a0d230f09926ebfd9
Refactor glance/tests/unit/v1/test_registry_client.py

Remove code duplication from module

Partially implements blueprint glance-tests-code-duplication

Change-Id: I85f5d7a45c65533ba49f2dfdefdfccfde221468b
Refactor glance/tests/unit/v2/test_registry_client.py

Remove code duplication from module

Partially implements blueprint glance-tests-code-duplication

Change-Id: Idf54d98d0982b7c64696056c87283eb92f1164b5
Code dedup in glance/tests/unit/v1/test_registry_api.py

Move duplicated fixture set-ups, requests and assertions to tests.utils.py

bp glance-tests-code-duplication

Change-Id: Ie0f13b5f5d5a242f24ac7cd6cc548ff09ebe6ba5
Avoid redefinition of test

test_add_member() is defined twice under the same
name, however checking for different things. Rename
the 2nd instance to _unauthorized to avoid overwriting
the first implementation.

The first check is actually duplicate to test_add_member_positive.
So merging the first check with test_add_member_positive.

Change-Id: Ifb029d8f34f9f4139557bb9b197492fb344a598e
add missing index for 'owner' column on images table.

Fixes bug 1214830

Change-Id: I13355cd53460188a5154aa3f50277c3e92335e28
Convert non-English exception message when a store loading error

In non-English environment when a store driver loading failed then a
BackendException will be raised with a non-ascii message. So we need
convert
any coded exception message to unicode string for logging.

This patch fixed a minor defect in
https://review.openstack.org/#/c/37421/
And the test case has be enhanced also.

Fixes bug 1202098

Related-Id: I9a58393b599aacc427cb4135988ecf5c3e90e455
Change-Id: I1cdc71537fc1205e5fa4ff9744b441e5d88c1d04
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Remove start index 0 in range()

Remove the useless arg ("start index" = 0) in files, since its default
value is 0, to make code cleaner.

Change-Id: I9d91ab8a8033b9a6c9b77608dea92c91a994c7fc
Add rbd store support for zero size image

If glanceclient does not provide image size to RBD store add() it
will create a zero-size image and fail when writing to it. If
provided with zero size we now work out the size of each chunk
being written and resize the rbd image prior to each write. This
will be much slower than if new the image size on create but it
will at least work.

There is a corresponding glanceclient fix to ensure content-length
is set if known by the glanceclient, see bug 1220197

Change-Id: I014c4b71c77c92b9876786d1ba438cdb90f83233
Fixes: bug #1213880
Implement protected properties for API v1

Related to bp api-v2-property-protection

DocImpact

Change-Id: Ia56ca251e78f37dcd6cf63c9696f0e5e07ed5f5c
Changed header from LLC to Foundation based on trademark policies

Fixes: Bug 1214176

Change-Id: I4e394c33d810fe7d48066ff7cb6143f7eae25f13
Remove the unused mapper of image member create

For image members v1, we don't support "create" method,
but we're mapping it in router.py. So this fix will
remove the unused mapper.

Fixes bug 1223658

Change-Id: I20401656ea2930a026cf8b67825d9ec9f6623487
Fix typo in protected property message

Fix for bug 1223861.

Change-Id: Idad6143fcd587779b94cb155ffbe489759275265
Disallow access/modify members of deleted image

It should not be possible to access or modify memberships for a
deleted image. A 404 error will now be returned if a deleted
images' members are accessed or modified.

Fixes: bug #1207266
Co-authored-by: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>

Change-Id: I3e1a7c1cd96b8c85cf0c20286533ced510580492
Merge "add missing index for 'owner' column on images table."
Convert location meta data from pickle to string.

This patch fixes a potential security issue.
Fixes bug: 1213241

Change-Id: I6414d16ec72f26ceabbaf1364ad737f19f18381e
Merge "Convert non-English exception message when a store loading error"
Fix misused assertTrue in unit tests

Refactored unit tests to use assertEqual instead of assertTrue
where needed.

Fixes bug #1226374

Change-Id: Iac5117c7a8dd3769aa6e303c6830aad291d5a0f7
Respond with 410 after upload if image was deleted

When updating the image after upload, we should return an
HTTPGone instead of a 500 error if the image cannot
be found.
This will provide more information to nova when this occurs
during snapshotting.

Fixes bug #1217838

Change-Id: I6e9875a9ff95ed3e9c38685785473138327ad4a1
Fixes typos of v1 meta data in glanceapi.rst

Fixes bug 1226701

Change-Id: Ie5547f5020d0dad3a2d9a9a96db0b5dd1d2dc34e