Unit tests for scrubber

This patch adds a place for unit tests for the scrubber. The test in
it addresses the change made at:
https://review.openstack.org/#/c/29405/

addresses bug: 1195423
blueprint: refactoring-better-faster-stronger-functional-tests

Change-Id: I02da0847c3f93474f478c8740e4649280a02eae1
Add v1 API x-image-meta- header whitelist

Add a whitelist of allowed 'x-image-meta-xxx' style
headers. Attempts to supply other, unexpected headers
will return 400.

This prevents cases such as 'x-image-meta-locations'
being processed, which were not being handled correctly.

Addresses bug 1205018.

Change-Id: I771bb6ae2a4f9cbd7726f952c7a71da99162b490
Sync models with migrations

Models should be the same as the state in DB after migration
blueprint db-sync-models-with-migrations

Change-Id: Iea57866206776c14677dfa78e868143b6fb153a9
Handle None value properties in glance-replicator

bug 1208417

In glance-replicator, all image properties in the master glance are
synced to the slave. But there are circumstances(kernel_id or
ramdisk_id, etc.) when image properties in the master are None.
glance-relicator doesn't handle this issue, thus all such properties
are trasnlated to the string 'None' in the slave glance, which is
incorrect.

This patch fixes this problem by add a check before post metadata to
the slave glance. All None properties are translated to '' before
posted to slave glance.

Change-Id: I9b674db907f707ac4dce28c8a7e3d81fcce61193
Text formatting changes

These are some text fixes in document, scripts and functions,
including variable usage, text aligning, adding new store class in
document

Change-Id: I98e226969d86698972870a7b3a042cb00c2206e9
Interpolate strings after calling _()

The original uninterpolated string is the key used to lookup translations,
so it's necessary to interpolate strings *after* calling into gettext.
Otherwise, the strings won't be translated correctly
This will ensure the string gets looked up by gettext correctly

Change-Id: I1a529bbc1e9ef6ee79502a66f68bc793d2e23b94
Merge "Handle None value properties in glance-replicator"
Merge "Interpolate strings after calling _()"
Update .mailmap

Change-Id: I5dc51c7aeb080945201376c42250502de601384a
Adding metadata checking to image location proxy layer

Enable image locaton proxy checking metadata when the location changing.
Implemented bp: location-proxy-metadata-checking

Change-Id: If411a454cd2c3e277ea9840cc3d83ec5125bb372
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Fix some logic in get_caching_iter

Mismatched indentation meant that more chunks than
expected could be yielded.

Make both filesystem ChunkedFile and S3 ChunkedFile
handle the case where the filepointer no longer exists.

Added unit tests which reproduced the problem
using both a filesystem and S3 ChunkedFile.

Fixes bug 1194929.

Change-Id: I0f70155e59f6bc754c88b5b9e96645459bfe770a
Remove glance CLI man page.

glanceclient CLI man page is provided by glanceclient.

Fixes bug 1212300

Change-Id: I61f61b50cb74d71331fadb89659a3cee2b13a359
Allow tests to run without installation

This patch makes modifications to the way that programs which the various
tests depend on are forked and executed.  This will allow the tests to be
run without installing glance to a python installation (ie: python setup.py
{develop/install} will not be needed).

fixes bug: 1197800

Change-Id: I9687cb7a5b22747d9cea0a1c24057383a8901476
remove flake8 option in run_tests.sh

flake8 read [flake8] section of tox.ini as options.

function run_flake8 in run_tests.sh should be kept simple,
and tox.ini controls the behavior of flake8.

Fixes Bug #1212988

Change-Id: I35d434ccea1ca2f3ff93657e4ca6dde93bbbf29e
Merge "Unit tests for scrubber"
Add space in etc/glance-cache.conf

Add space in "known_stores" block in etc/glance-cache.conf,
and keep glance code tidy and pleasing.

Change-Id: If112db41bfbce9f78013fe33229043f0f626f3f9
Make disk and container formats configurable

* Add disk_formats config attribute
* Add container_formats config attribute
* Implement bp configurable-formats

Change-Id: Ic52ffb46df9438c247ba063748cadd69b9c90bcd
glance-replicator: enable logging exceptions into log file

bug 1213779

Currently, glance-replicator provides option to enable logging
information into a specified file. But exceptions are not logged
into the log file when they are thrown.

Reproduce steps:

When setting a wrong source or target address, exceptions would be
thrown, but not logged into log file.

Change-Id: Ic2c59e04aa6099f3ede0c6b8579c31a3dfff895c
image-delete fires multiple queries to delete its child entries

1. Changed individual query calls for soft-deleting the image's
   child entries to one db query call for all child entries of a
   given type.
2. Added a fix to simple db's 'image_destroy' api to clear
   the location entries.

Fixes bug 1201758

Change-Id: Ib673de5460d59ea3af74553048ffcf74dccbdc36
Make sure owner column doesn't get dropped during downgrade

Fixes bug 1204941

The owner column was missing from the table schema. Because of limitations
of sqlite and implementation details in SQLAlchemy-migrate, this would end
up dropping the owner column during a downgrade when using sqlite.

Change-Id: If8f7f16c9b6fb059f0fcfdf8967afd37f19864b6