Commit Graph

24 Commits

Author SHA1 Message Date
Erno Kuvaja 3068096199 Cleanup remove api v1 and registry code
Change-Id: I86a3cbf4374bc2b083ccd86f75b88490b305eaab
2020-07-14 10:38:19 +00:00
Matt Riedemann 88a8ad7823 Fix DeprecationWarnings for RequestContext.tenant/user usage
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
2019-02-06 09:59:36 -05:00
Dharini Chandrasekar 34be9d9283 Improving help text for send_identity_headers opt
Change-Id: Id3e485643ffa761bb827a80f212339ac3c1d7a6a
Partial-Bug: #1570946
2016-08-31 17:38:52 +00:00
kairat_kushaev c27c25f779 Import i18n functions directly
Import i18n functions from module directly and do not use
global module variables like _ = i18n._. It makes code shorter
and cleaner. It also to detect cases when these functions are not
used in module.

Change-Id: Iaa593ac1f2dd15cbcad049bef6ba68f1cfa610da
2015-12-07 18:20:43 +03:00
Hemanth Makkapati dcbf54672c Scrubber to communicate with trustedauth registry
Glance scrubber needs admin context when attempting to talk to
registry to list, update and delete images. However, when registry
is deployed in trusted-auth mode, appropriate admin role is required
to gain admin context on registry.

Closes-bug: #1439666

Change-Id: I5ff68ef8f30e73642889f8e4cde7ba06628cb0e5
2015-09-09 23:14:15 -05:00
Jenkins d679404527 Merge "Drop use of 'oslo' namespace package" 2015-05-01 15:24:24 +00:00
Doug Hellmann ae21f4dffa Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Ifa8baab33cdb3e606cf175a8c29c3a4ef6c44480
2015-04-28 18:57:45 +00:00
Kent Wang 90d8f9b9c7 API calls to Registry now maintain Request IDs
Previously, glance-api calls to glance-registry did not include the
req-UUID request ID in that call. Instead a single call to glance-api
used separate request IDs for api and registry, leading to some
difficulty in traceback, debugging, and tracking bugs going into
glance and into registry.

Previous example log in glance-api:
2015-04-21 07:25:10.359 126050 DEBUG glance.registry.client.v1.client
[req-f2abec73-7a8c-4c5a-bded-f5eb82d627e4 5fca8fda352e46c7a006d4bf8083ab
be 00eb1978c3394438b8988cd8a755f128 - - -] Registry request GET /images/
05454482-f448-424b-ba9d-49d44a5af9fb HTTP 200 request id req-req-2433213
e-76c2-4ce3-95b6-d0db6cc8bdd0 do_request /opt/stack/glance/glance/
registry/client/v1/client.py:131

Updated example log in glance-api:
2015-04-21 07:27:33.057 126165 DEBUG glance.registry.client.v1.client
[req-1787ffe1-0537-4357-a735-18412292434d 5fca8fda352e46c7a006d4bf8083ab
be 00eb1978c3394438b8988cd8a755f128 - - -] Registry request GET /images/
05454482-f448-424b-ba9d-49d44a5af9fb HTTP 200 request id req-req-1787ffe
1-0537-4357-a735-18412292434d do_request /opt/stack/glance/glance/
registry/client/v1/client.py:131

Now, when glance-api calls glance-registry, the api request_id is passed
to registry. This helps to maintain the request ID for api and registry
when user makes a single call to api.

Change-Id: I871c1c17aca9af291598279db1d4057e217b4256
Closes-Bug: #1336958
2015-04-22 07:05:06 -07:00
Louis Taylor 0acff569e0 Move to graduated oslo.log module
This removes the log module from the oslo incubator directory.

Change-Id: Ib017cc2777e27c58b376c3138c9fba614783cc34
2015-03-12 11:48:24 +00:00
Louis Taylor d759a6fd1a Move from oslo.config to oslo_config
oslo_config was moved out of the oslo namespace in oslo.config>=1.6.0.

Related-to: blueprint drop-namespace-packages

Change-Id: I30ecbf8f9de77496fcb643c7ad9738d79ad359f0
2015-01-12 14:34:22 +00:00
Nicolas Simonds 348cef70b9 Allow $OS_AUTH_URL environment variable to override config file value
Make the Glance APIs use this value in a consistent/expected manner
when it is set.  The Principle of Least Surprise dictates that
setting the value in the environment should override any values in
the config files.

Change-Id: Icdc39a2fd0da71a75f4ad0e60e34cfb8e1883787
Closes-Bug: 1314354
2014-12-20 05:50:58 +00:00
James Carey 3f2a56ae65 Move from using _ builtin to using glance.i18n _
The builtin _ should not longer be used.  Instead _
should be explicitly assigned from glance.i18n.

This patch does the following:
  (1) adds these explict assignments to any
      glance file that was missing them,
  (2) removes the defintion of _ as a builtin from
      tox.ini so that a pep8 failure will occur
      if _ is not defined,
  (3) removes calls to install().

This removes the last direct use of gettextutils by glance.
The indirect uses, via openstack/common, will be removed
in the next sync with oslo.

Change-Id: Ie54e8a67e747e022cc01022dfad35d89686bdfc4
2014-11-21 18:51:19 +00:00
Stuart McLaren cc7ae2abd5 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
2014-10-28 15:39:21 +00:00
Julien Danjou 581cb4ca43 Switch to oslo.serialization
Change-Id: I983bb5b6e2c7fbbd8556ff0f99212803cb0269e9
2014-10-07 14:58:55 +02:00
Brant Knudson adeca09124 Use auth_token from keystonemiddleware
The auth_token middleware in python-keystoneclient is now
deprecated and has been moved to keystonemiddleware.

Closes-Bug: #1342274

Change-Id: Ic8ba2d2f470ec052ba13c3b63b26d5e2270f7412
2014-07-15 18:36:14 +00:00
Christian Berendt 86dd9ff66c debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

This patch adds a new hacking check - N319 - that ensures all
debug log messages don't have translations.

Change-Id: I9dd958b904671a7eb95883026e14684469dc52d5
Closes-Bug: #1317847
2014-05-23 15:57:06 +02:00
Noboru arai 8de10b0f34 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I3b830a5bb831a63c188109e6fad66ba48884fff3
Partial-Bug: #1229324
2014-01-14 16:03:28 +00:00
Yanis Guenane 16c3a33c0b Migrate json to glance.openstack.common.jsonutils
Every call to json.loads/json.dumps have been changed to
jsonutils.loads/jsonutils.dumps respectively. Import json has been removed
also replaced by import glance.openstack.common.jsonutils

654d80b416dc5f413cb791aa838ec8688bf7da44 Create openstack.common.jsonutils

Change-Id: I8ef580e5eb91526dfaef37050ce1f5c6d88d56b5
Closes-bug: #1257922
2014-01-05 14:38:07 +00:00
Edward Hope-Morley 51ecc8016a Adds guard against upload contention
Protect against concurrent image uploads by allowing the
initial request to proceed and succeed and subsequent
concurrent requests to fail.

We now allow the upload activation to specify what state
it expects to transition to 'active' from. If by the time
the db is updated the transition has already occured i.e.
another upload has succeeded, the upload will fail and data
will be cleaned up.

Fixes: bug 1241025
Change-Id: Ie532b61484bec660910fb9a37429397bde8ef11f
2013-12-19 14:26:40 +00:00
Dirk Mueller 518bbf7298 Changed header from LLC to Foundation based on trademark policies
Fixes: Bug 1214176

Change-Id: I4e394c33d810fe7d48066ff7cb6143f7eae25f13
2013-09-10 18:29:53 +02:00
Zhongyue Luo dbcc1b78ec Removes duplicate options registration in registry clients
Fixes bug #1204359

Change-Id: I5b8bd9e4465d9fe70e9311474bc2b00d9afcf046
2013-08-16 17:42:11 +00:00
Alex Meade 3fa3891595 Glance api to pass identity headers to registry v1
This patch introduces the send_identity_headers
config option that allows glance-api to pass auth identity
headers when making calls to the registry v1.

docImpact
Fixes bug 1199990

Change-Id: Ie5f07ed6dfeaa8428de4f79c4d40d182328e6ab4
2013-07-22 22:25:51 +00:00
Alex Meade be34808c7b Make passing user token to registry configurable
This patch adds CONF.use_user_token as a config option. When true, glance will
continue to use the user token when communicating with glance registry. When
false, glance will read admin credentials from the config and use those to
communicate with glance registry. Using admin credentials allow for
reauthentication when tokens expire and prevents requests from silently failing.

DocImpact
Fixes bug 1182536

Change-Id: Ia6b563677eb67d4069571c82b9dad3f025b6e9fb
2013-05-24 12:27:07 -04:00
Flaper Fesp 9174753332 Create package for registry's client
Currently, Registry's client doesn't have a version and It's being
imported from glance.registry.(__init__|client).

As part of the blueprint registry-api-v2 the registry's client will be
modified. That for, it is necessary to keep backward compatibilities
with older versions until the db-registry-driver is completed.

This code might be removed / re-factored in the future once glance's api
v1 will be migrated to use the db-registry-driver.

Change-Id: I3f27cec5b6e5f857d7aa94731305629190ae642e
2013-05-01 22:34:17 +02:00