Refactor tests.unit.utils:FakeDB.reset

glance.tests.unit.utils:FakeDB uses glance.db.simple.api which has
already implemented reset() functionality, the redundant code in
FakeDB should be removed.

Change-Id: I140e932e9cc531900cee503e20d3549549b13d27
Closes-Bug: #1264204
Remove the redundant code

In methods 'version_control' and 'db_sync' in glance/db/sqlalchemy/migration.py,
there are redundant code 'sql_connection = CONF.sql_connection'.
The 'sql_connection's are local variable and not used.

Change-Id: Ie8a12e6f385f7103463172ed9acde1de0336a6d4
Closes-Bug:#1264056
Fix and enable gating on H306

Fix fallout of Hacking check: Imports should be in alphabetical order

Change-Id: I179711c8448208592490ffa47d51419779940014
Merge "Refactor tests.unit.utils:FakeDB.reset"
Merge "Fix and enable gating on H306"
Disallow negative image sizes

Currently Glance v1 allows creation of images with negative sizes when
the source URL provided by the --location parmeter does not exist at
the time of creation.

There is already a check to verify whether or not an image size can be
converted to an int but the check doesn't verify whether or not the
resulting value is >= 0. This commit supplements that check to
disallow negative values for the size parameter.

Change-Id: I47511f3e34cf5adfdf944747d94285ecbbda4249
Closes-Bug: #1260738
Merge "Remove the redundant code"
Merge "Disallow negative image sizes"
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
Allow showing a deleted image when doing a get /images/id.

This is changing behavior for both v1 and v2.

Change-Id: Ie5d1e120ad96547860c9b7d4a84c47857a142479

Ply-Patch: Allow-showing-a-deleted-image-when-doing-a-get-image.patch
Updates image in image.delete notification

In order to ensure that image properties are sent in image.delete
notification, one of the earlier commits had changed the code to send
the old image information in the notification. But the old image had
attribute values deleted:false and deleted_at:null. So, this patch
tries to keep the old image properties, but ensures that the correct
deleted and deleted_at values are sent.

Change-Id: I3971869f1ef512a0eaea493f987e898f481cf517

Ply-Patch: Updates-image-in-image.delete-notification.patch
fixes a import error test failure

httplib is being used in glance/tests/unit/v1/test_api.py however was
not imported. This commit fixes one failure in test because of that.

Change-Id: I6c54a5319b8ffb56a7c6052afdde7cff36f5a039

Ply-Patch: fixes-a-import-error-test-failure.patch
Logging 2 debug incorrect meta in scheduled images

Addresses rm1989

Change-Id: I863976f52389f4b09ed380460740ec80f701c311

Ply-Patch: Logging-2-debug-incorrect-meta-in-scheduled-images.patch
Makes v1 show only 'accepted' images in image list

Addresses rm3709

This change tries to bring consistency in the way v1 and v2 show shared images.
While, v2 shows only accepted images in the image list, v1 shows both pending
and accepted images. This change makes v1 show only accepted images.

Change-Id: Iaae44d7625bd007bb12299e78e30f23f780e895f

Ply-Patch: Makes-v1-show-only-accepted-images-in-image-list.patch
Adds rax-filter to Glance V2

Addresses rm3790
This change is a rax-patch to introduce rax-filter to Glance V2.

Change-Id: I7dd97360ef4eaf41945f9c6c455813dd2e77d4b0

Ply-Patch: Adds-rax-filter-to-Glance-V2.patch
temp