This option was deprecated in the Ussuri release by change
I0f61f85a0aaa4f68e345fa08fbb6b039d3d32587 and it is now eligible
for removal following the standard OpenStack deprecation policy.
Change-Id: I78ec79f97bfdcc39772448296140f8d8f35adea1
RequestContext.tenant and user fields are deprecated in favor
of project_id and user_id respectively.
This change modifies the glance.context.RequestContext constructor
to transition usage of tenant/user to project_id/user_id until
all tests are moved over to the new attributes. Runtime usage of
the old fiels is updated.
To prevent new code from using the deprecated fields, a warnings
filter is added which will make tests fail if they hit code using
the old fields.
Co-Authored-By: Abhishek Kekane <akekane@redhat.com>
Change-Id: I351380840308a24769ece93abc6d1a9a6d6aa06f
The oslo.context change If48ee7f4d1c113f1f26b3b1698c6b055807b950f
will change request_id type on Python 3 from bytes to str. This
change prepares Glance for this change.
Change-Id: Ia8578ecab1b1f1bf21020c91290458efad646cd9
Check if request-id starts with 'req-' in context middleware,
if not then add prefix 'req-' to request-id.
Change-Id: I4fae1f6274b5d89fd3bdd1aefd4abc2129afd8ef
Closes-Bug: #1478690
Fix a bug with storing the request context in thread local where the
storage was not properly cleared between requests.
(This was causing the same request to always be logged.)
Closes-Bug: 1384911
Change-Id: Ie30b93900451b0f9f6fd8158457b0b66903af470
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
Replace assertEqual(None, *) with assertIsNone in glance's
tests to have more clear messages in case of failure.
Also, replace assertTrue(* is not None) with assertIsNotNone
for the same reason.
Change-Id: If41a71bd750057c7136b03bef94c04517092134c
Closes-Bug: #1280522
Add the Apache headers where it was missing so the Glance
code base can be H102 compliant
Change-Id: If19841d1752f7ec364098333429ce090374e79cd
Closes-bug: #1263537
Updates the ContextMiddleware so that it stores the service_catalog
which from set via Keystone's auth_token middleware.
The motivation for this change is that we'll need access to the
'object-store' endpoint in order to implement swift tenant specific
storage.
Partially implements blueprint: swift-tenant-specific-storage
Change-Id: I0389e135f6683a353ae915b543d70f6ac1246b2c
* Generate a uuid in RequestContext.request_id on init
* Present request_id in an 'x-openstack-request-id' header using
process_response in the ContextMiddlewares
* Related to bp glance-request-tracking
Change-Id: Idd9b86661322250b6167a1ee23e5baae91066ff6
* Move RequestContext class to glance.context
* Move context middlewares to glance.api.middleware
* Update tests to reflect move
* Update paste configs
Related to bp glance-request-tracking
Change-Id: I289b546ec28c973a3022be779ce378ae2febb340
Implements blueprint cfg-global-object
In glance.common.wsgi we have a paste_deploy_app() API which allows
a ConfigOpts instance to be passed the the applications and filters
constructed by PasteDeploy.
Now that we're using a global object, we don't need this anymore
Change-Id: I222d3c58308bc2f504cd802c0c8405d3baa2e49a
Implements blueprint cfg-global-object
This iteration fixes up the remaining places where we're passing a
conf object around.
Change-Id: I3b627d093a6b7afeee129ab66b377a3b0af5439b
Certain deployments need to allow anonymous access to its
images. This patch allows a user that has failed to authenticate with
Keystone to access the API in read-only context.
* Configure through 'allow_anonymous_access' option, defaults to False
* Implements bp api-v2-anonymous-access
Change-Id: Ia8f57e54bd141a2da1ca4600d1970558fb497f67