Opening stable/juno

Bump version to next stable release on juno branch, and set
defaultbranch in .gitreview for convenience.

Change-Id: I801b6e599d79f5cf6d171b27722de21687a4661a
Can not delete images if db deadlock occurs

Glance api returns 500 Internal Server Error, if db deadlock occurs
in glance-registry for some reason while deleting an image.

Added retry on image_destroy when db deadlock occures which will again
try to delete the image from database.

Closes-bug: 1378215
Change-Id: Ifad403e363daf368e846b5b6838432a7bedbe81a
(cherry picked from commit dae0fa8f1071be41d5541e9a5254abea48f5ba36)
Improve error log for expired image location url

If image is not present at the specified location while creating instance
from image, then HTTPInternalServerError 500 response along with stack trace
is logged on nova compute which does not help user to understand the exact
cause of failure.

Return HTTPNotFound error to the nova compute in case of image url got
expired or image is not present at the given location to give clear
indication of the cause of failure to user.

Closes-Bug: #1198566
Change-Id: I9acd9112aeae8d3b3c0c3921f306e716e5808c2e
(cherry picked from commit 633bec8fd45897735e1fcb9844903fe597903b21)
Fix for adopt glance.store library in Glance

The store module is removed from glance project and new glance_store
module is created, but the glance project code was not updated
properly for the required changes.

_get_from_store and _get_size methods raises store.NotFound exception
from glance_store but not caught in the glance api.

Updated exception.NotFound to store.NotFound which returns 404 NotFound
response to the user.

Closes-Bug: #1380552
Change-Id: I068cb90f5db62443115157a027fbdefec9bd4a00
(cherry picked from commit 675a39a74faad5f7fe4eb94e1dcf7f4359ed2285)
Upgrade tests' mocks to match glance_store

Latest glanec_store release added a new `context` keyword to some
functions. This broke backwards compatibility for some of the tests in
master and juno.

This change adds the corresponding keyword to the mock calls.

Closes-bug: #1391437

Change-Id: I5e58462e4c076b3ea56e27361eb6c3b0aafa2493
(cherry picked from commit 6b3edb2a48e3d77a623862853690bb72f31d213a)
Swift Multi-tenant store: Pass context on upload

Image upload returns an E500 as the context is not being
passed to the swift client.

Change-Id: I2065b7dd281bfbb513f13270a0c062fc7132f763
Partial-bug: 1385213
(cherry picked from commit 867b696d884e9db707683eecd321789843798efd)
Make RequestContext use auth_token (not auth_tok)

The RequestContext class from oslo-incubator uses 'auth_token'.
Glance's RequestContext uses 'auth_tok' -- which is inconsistent.

glance_store currently uses the oslo 'auth_token'.

We should not assume a 1-1 mapping from the glance_store to glance,
nor should we have glance_store support both 'auth_token' and
'auth_tok'. Therefore Glance should be updated to use 'auth_token'.

This change was generated automatically with:

$ for file in `find glance -name '*\.py' -exec grep -wl auth_tok "{}" \;` ; \
  do sed --in-place 's/\<auth_tok\>/auth_token/g' $file ; done

In addition, the set_auth_token function was removed. This had been used
by Nova to work around the auth_tok <-> auth_token inconsistency, but
was removed in mid-2012 as part of the move to python-glanceclient so
is no longer needed.

In conjuction with other changes this fixes image upload when
using the multi-tenant Swift store.

Change-Id: Ic8a5f44088990fd8f6290a5622b823f59ef365fc
Partial-bug: #1385213
(cherry picked from commit cc7ae2abd5c67b5573ca609e27c79d5c4f9a528d)
Image not downloaded without restricted property

If restrict download rule is configured in policy.json, and image is
added without protected property mentioned in "restricted" rule, then
normal users (other than admin) are not able to download the image.

Added logic in policy.py, to allow normal user to download image
without restricted property.

https://review.openstack.org/#/c/127923/
Above patch will fix the issue for master, but as it is too large to
be back-ported to stable/juno, Nikhil recommended to push only minimal
changes that fixes this issue after discussing it with the release manager.

In this patch, I have copied required changes from oslo-incubator
policy module from commit 33533b0d97639ed828a2fd5e874f16eb1ecfeaa4.
Note: In juno release, oslo-incubator policy module was not synced
with glance completely. 

Closes-Bug: #1387973
Change-Id: Ib85901b073c85ede7da2e9c7333426c8b8de3bb6
Merge "Image not downloaded without restricted property" into stable/juno
Merge "Fix for adopt glance.store library in Glance" into stable/juno
Merge "Swift Multi-tenant store: Pass context on upload" into stable/juno
Merge "Make RequestContext use auth_token (not auth_tok)" into stable/juno
Merge "Improve error log for expired image location url" into stable/juno
Disable osprofiler by default

This could cause issues when upgrading to juno, since if config files are not
updated osprofiler can crash.

It is disabled by default in other services, such as cinder and heat.

Change-Id: Ide1be0d42e9e3640560564005b2ce1ffdf554e25
Closes-Bug: #1387320
(cherry picked from commit 090cb56ba100d53dc7c95148dde77a8a4969adfe)
Updated from global requirements

Change-Id: Iee5554ddc36e58163d260175964dad8b759c94ec
Updated from global requirements

Change-Id: I75172700283a95e1e056b8ee35688e9a83321e72
Don't access the net while building docs

(Note this hasn't been submitted upstream)

Change-Id: I42c6e3a5062db209a0abe00cebc04d383c79cbcb
(cherry picked from commit f2b4bb4e45afcc178200966193a7b87401c534d7)
Remove runtime dep on python pbr
avoid unsupported storage drivers
notify calling process we are ready to serve

Systemd notification should be sent in-process, otherwise systemd might
miss the subprocess sending notification.
See systemd bug https://bugzilla.redhat.com/show_bug.cgi?id=820448

Taken from keystone project commit
abc06716d027d68f0da3b0f559fa7c85a21804d5

Improvements from Keystone version:

    * add unset_environment parameter
    New parameter unset_environment was added to sd_notify
    http://www.freedesktop.org/software/systemd/man/sd_notify.html
    to ensure service readiness is sent only once.

    * add onready() method to simulate systemd environment
    For testing purposes and optional use with SysV initscripts.

    * unit test added

    * docstrings for notification methods

Patch includes deployment in openstack.common.service.
It does not have an effect when running the service outside
the systemd environment.

Implements: blueprint service-readiness
Change-Id: I80f325c9be9c171c2dc8d5526570bf64f0f87c78