Commit Graph

17 Commits

Author SHA1 Message Date
Stephen Finucane dc20d4a2a2 tests: Use WarningsFixture in all tests
Change-Id: I3e2227a01628f8f5d14d4b4ebf11a9374b52c228
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-07-24 17:14:15 +01:00
Dan Smith 16a5431c66 Make glance-api able to do async tasks in WSGI mode
This teaches glance-api how to do async threading things when it is
running in pure-WSGI mode. In order to do that, a refactoring of things
that currently depend on eventlet is required.

It adds a [wsgi]/task_pool_threads configuration knob, which is used
in the case of pure-WSGI and native threads to constrain the number
of threads in that pool (and thus the task parallelism). This will
allow tuning by the operator, but also lets us default that to just
a single thread in the backport of these fixes so that we can avoid
introducing a new larger footprint in the backport unexpectedly.

Partial-Bug: #1888713
Depends-On: https://review.opendev.org/#/c/742047/
Change-Id: Ie15028b75fb8518ec2b0c0c0386d21782166f759
2020-07-24 11:13:45 -07:00
Corey Bryant f537389811 Handle StopIteration for Py3.7 PEP 0479
Replace raise of StopIteration with return.

PEP 0479, https://www.python.org/dev/peps/pep-0479/, makes the
following change: "when StopIteration is raised inside a generator,
it is replaced it with RuntimeError".
And states: "If raise StopIteration occurs directly in a generator,
simply replace it with return."

Change-Id: Ia7d6af7165077aa93c76185c28c355c06a202088
Closes-Bug: #1781627
2018-08-07 14:44:03 -04:00
Erno Kuvaja 3dde3204d5 Remove Images API v1 entry points
This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command

This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.

Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
2018-07-13 10:21:49 +01:00
Victor Stinner 3924ab0db4 Port api test_common to Python 3
* Replace gen.next() with next(gen)
* tox.ini: Add glance.tests.unit.api.test_common to Python 3.4

Change-Id: If9c730db8b29e58ed87d8e587c03461ac7a921cd
2015-10-05 16:33:22 +02:00
Roman Vasilets cb2456ea5e Wrong order of assertEquals args(Glance)
Args of assertEquals method in glance.tests are arranged
in wrong order. In result when test fails it shows incorrect
information about observed and actual data. It's found more
than 2000 times. Right order of arguments is "expected, actual".

Change-Id: Ifea4809f5a696b608a19e36a9ed9e5eec46c8a21
Co-Authored-By: Li Yingjun <liyingjun1988@gmail.com>
Closes-Bug: 1277104
2014-11-13 17:10:09 +02:00
Julien Danjou fadbef8511 hacking: upgrade to 0.9.x serie
Change-Id: I252758fd633662de9659a402c5e3d7e3ce1fae0f
2014-10-06 14:41:03 +02:00
Yanis Guenane ec08ca1a87 Make code base E125 and E126 compliant
This commit makes the glance code base E125 and E126 compliant :
  * E125 continuation line does not distinguish itself from next logical line
  * E126 continuation line over-indented for hanging indent

Change-Id: I7120149bedb665fb66320498fe98948602a6cd52
Closes-bug: #1263437
2013-12-30 13:03:24 +00:00
Victor Sergeyev 88bb1af1d5 Enable F40X checking
Clean up imports due to F401 and F403 checks.
F401  'module' imported but unused
F403  unable to detect undefined names with wildcard import

Change-Id: I487edb157de1a6babc7ad8a3fb65f195e476c490
2013-11-27 18:15:48 +02:00
Dirk Mueller 753885d3cd assertEquals is deprecated, use assertEqual
Also change to assertTrue/False where assertEqual(True,/False) was
used.

Change-Id: I9e592d9c40c3da61b5e7af7e7ad5247645249eff
2013-11-07 02:34:48 +01:00
James Li abbc535333 Redirects requests from /v# to /v#/ with correct Location header
This is a continuous fix to bug #1166957

VersionNegotiationFilter pops off the version string of PATH_INFO,
the popped segment is pushed onto SCRIPT_NAME, which results in
dual version strings (e.g. '/v1/v1/') in the 'Location' header
of a redirect response. This may result in a further 404 error
if the http client will automatically follow the returned
redirect.

Fix this problem by adding a private method which does not
push the popped segment onto SCRIPT_NAME.

Change-Id: Ie0c244af38534dde2058828fbff840a845cc7c90
Fixes: bug #1175815
2013-05-08 21:16:29 +00:00
James Li 39477afb0e Redirects requests from /v# to /v#/
Added an APIMapper to catch routemaps when the url is ''
because routes.Mapper returns an error if this is the case
but we want a redirect

Refer to the Nova code at:
https://review.openstack.org/#/c/886/

Change-Id: I74011d14a02a3bc8767fab559ada4c2d82dc5d6e
Fixes: bug #1166957
2013-04-26 19:13:04 +00:00
annegentle a2b9bed75d Updates OpenStack LLC with OpenStack Foundation
Patchset addresses reviewer's comments, rebase against master,
and follows new guidance from Foundation:
http://wiki.openstack.org/Documentation/Copyright

Change-Id: I94367461505778973528eb8835d991f4fb796dab
2013-02-17 19:19:43 -08:00
Monty Taylor b5e60b7e78 Use testtools for unittest base class.
While doing this, remove some of the nose-isms, which don't play nicely.

Part of blueprint grizzly-testtools

Change-Id: I9ea398b25195ad5f9c5db876c3dbb49ef4a5ee99
2013-01-12 19:17:08 +00:00
Zhongyue Luo ce85c38158 Fix import order nits
Change-Id: I972c463131ba688ab9352590eb53f5b1822ac943
2012-12-31 22:12:53 +08:00
Zhongyue Luo ba3d3728d1 Clean up pep8 E121 violations
Fixed E121 errors.
All other ignores are to be removed in the next sequence of patches.

Change-Id: I5d3f490a1bfbe1945a23a7fc1f38d818c0650ff7
2012-09-19 14:55:02 +08:00
Brian Waldon 047a6f838a Add unit tests for size_checked_iter
Change-Id: I3822d093571b02b2bb9a7d0b7d6cb4c1a0b9e812
2012-09-13 16:56:55 -07:00