Tests added for glance/cmd/cache_cleaner.py

Integration test test_cache_cleaner_main added to cover
chain of calls between glance/cmd/cache_cleaner.py and glance/image_cache
module.
Unit test test_cache_cleaner_main_runtime_exception_handling added to
cover exception handling for main() method of cache_cleaner.py

Change-Id: Ic05f35dd3f0a93d4331ccb5e470cdb71d9eab605
RBD add() now returns correct size if given zero

If the RBD store add() is provided with image_size of zero, it
will calculate based on data provided and return the new size.

Change-Id: I06375bcfef7808905b466432e5ca100c942297eb
Closes-bug: 1256044
Glance image-list failed when image number exceed DEFAULT_PAGE_SIZE

The root cause of the problem is that DB2 does not allow
an empty string ('') for datetime field. So we set the
default value of datetime as None.

Fixes bug 1245947

Change-Id: Ie372efe70a068024298fbde4574e33e565cc6c9a
Remove TestRegistryDB dependency on TestRegistryAPI

TestRegistryDB does not set up the sqlalchemy db it uses with the db models.
These tests only pass when run in conjunction with TestRegistryAPI because that
test case does set up the db. TestRegistryDB should set up the DB as it needs
to.

Fixes bug 1247629

Change-Id: Ib0629634e567e1fb9b98dac50025f5309cd4efec
Added error logging for http store

http store logs an error message when the remote location
fails to return the image, returns invalid status or
if it exceeds maximum redirects

Change-Id: I43c74395bc4632a97761ae4c11474bfeb823c85a
Closes-Bug: #1257234
Refactor StorageQuotaFull test cases in test_quota

There were two test cases in test_quota that shared the same name, but
did almost the same thing. After a bit of digging, it looked like most
of the test cases did the almost same thing, so I refactored the common
bits and fixed the test case name duplication.

Partial-Bug: #1259036
Change-Id: I828eea570d358d98520c7201454c03ba174a35ad
Enforce copy_from policy during image-update

The enforcement of the copy_from policy is missing during update allowing
every user to do this action no matter what is defined in the policy.json

Change-Id: Iecf11bdf220b37d9ecbb6fc686214d14acf1d3dd
Closes-bug: #1259241
Merge "RBD add() now returns correct size if given zero"
Merge "Remove TestRegistryDB dependency on TestRegistryAPI"
Merge "Refactor StorageQuotaFull test cases in test_quota"
Merge "Added error logging for http store"
Merge "Glance image-list failed when image number exceed DEFAULT_PAGE_SIZE"
Merge "Tests added for glance/cmd/cache_cleaner.py"
Remove duplicate method __getitem__ in quota/__init__.py

Fixes bug 1259477

Change-Id: I19446881a5e23f0f72e0e383b3330ce851277f89
Merge "Enforce copy_from policy during image-update"
Merge "Remove duplicate method __getitem__ in quota/__init__.py"
Periodic image.exists event generation

Implements blueprint glance-exists-notification

Adds a script which can be run periodically to generate an image.exists
notification for each image that was active at any point during the
past audit period. The following types of images are considered to have
existed during the given audit period:
-  active images that were created before or during the audit period
-  images that were active but were deleted during the audit period.
To determine if an image was or is active, we check if its location is
set and that its created_at/deleted_at values are in the audit period.
The exists messages support pagination and the page-size can be
supplied as a commandline argument.

Change-Id: I69a89f110093f9bf965a289ede6f1b45ab772a0f

Ply-Patch: Periodic-image.exists-event-generation.patch
pass tenant around for rackspace auth

Change-Id: I3eca33aab81615422a9c63cfd95fd5d9ebf3eaa0

Ply-Patch: pass-tenant-around-for-rackspace-auth.patch
Filter images based on what type of RAX customer they are

Implements B-24889

Images are filtered based on if the image if visible and/or buildable for
to the type of customer they are.

All properties checked are prefixed with 'com.rackspace__1__' and
omitted below only to make it format easier.

When listing images, a property is checked to ensure it is visible to
the user. If the user has the rax_managed role, the 'visible_managed'
property is checked to make sure it is '1'.

If the user does not have the role, then the 'visible_core' property
is checked to make sure it is '1'.

If the user has the rack_connect role, then the 'visible_rackconnect'
property is also checked to make sure it is '1'.

When an image is retrieved, then the same checks are made but with the
'build_*' instead of 'visible_*'.

Change-Id: I6f6f32c9cdf4ed023c665a0353415f76f7165852

Ply-Patch: Filter-images-based-on-what-type-of-RAX-customer-the.patch
Only filter public images by RAX customer type

Change-Id: I21c2437c46ae707b7a241fdb398747ceef10b666

Ply-Patch: Only-filter-public-images-by-RAX-customer-type.patch