Commit Graph

7 Commits (99f4495c940011293e3cabbb590770dc1e7b6900)

Author SHA1 Message Date
Mykola Yakovliev d62d82b0fe Generate correct url in api pagination
Use protocol from X-Forwarded-Proto, and not from current endpoint.

Change-Id: I3fafc4ef1cf56cb8f1cddc1a003a755e3f93c75c
Closes-Bug: 1774460
5 years ago
Mark Doffman f45957a67f Add a new configuration variable for api links.
Currently we use WebOb.request.application_url to return a link to the
neutron api. This may not be the correct link in the case where
'X-Forwarded-Proto' is used. Nova provides the osapi_compute_link_prefix
variable for providing custom links to the api. This does the same
for Neutron.

Co-Authored-By: Kevin Benton <kevin@benton.pub>
Change-Id: I92227803b1bc2fec10ee168a0285f2f6f09f55b0
6 years ago
Gary Kotton 49609f36f5 Remove deprecated class NeutronController
Commit 9b8bf7d25c marked
NeutronController as deprecated.

This code is no longer used in Neutron and there is no need for
the class nor the unit tests for it.

TrivialFix

Closes-bug: #1625140

Change-Id: Ie02b6f1a45c3ea32a1116a48946c59673e2d2472
7 years ago
Gary Kotton 9f09f27c5d Fix deprecation warnings
Remove deprecation warnings for various constants
and exceptions that have moved to neutron_lib.

Fix miscellaneous other deprecations.

Uses constants instead of l3_constants when importing
neutron-lib constants.

Co-Authored By: Henry Gessau <gessau@gmail.com>
Co-Authored By: Gary Kotton <gkotton@vmware.com>

Change-Id: Ib0e8ff5c3e23677c1009241a1818cbc8a3430c38
7 years ago
Ihar Hrachyshka ce0981fa20 Don't return marker item when paginating backwards
In emulated pagination mode, we should not return the marker when
paginating backwards (page_reverse), same as we do when we paginate
forward, or when we paginate backwards with a plugin that supports
native pagination.

Closes-Bug: #1591981
Change-Id: I8b553ab22846122dde22372f9901e46a5276ee8e
7 years ago
Kevin Benton f7a0c0b044 Convert multiple exception types in the API
The callback framework will collect all exceptions that occur
during the notification loop and raise a single exception
containing all of them. The issue with this is that the code
that notifies has to manually unpack the exceptions and choose
what to reraise for the API layer even if it has no other reason
to catch the exception (i.e. any encountered exceptions should be
fatal). If it doesn't, the server will just return a generic HTTP
500 error to the user even if the internal exception is a normal
error that would convert to a 404, 409, etc.

This patch makes the API exception conversion layer aware of
exceptions containing other exceptions so code no longer has to
catch callback failures if it has no specific error-handling logic.

Multiple exceptions that translate to the same HTTP error code will
be converted into one exception of the same error code with the
details of each exception line-separated in the exception message.

Multiple exceptions that translate to different HTTP error codes will
be concatenated together line-separated with their HTTP error prefixes
into an HTTP Conflict exception.

If there is only a single exception in the multi exception type, the
inner exception is used directly.

Partially-Implements: bp/multi-l3-backends
Change-Id: I528de088079b68cf284ef361fee9bd195125e0d8
7 years ago
Maru Newby 1105782e39 Reorganize unit test tree
This change ensures that the structure of the unit test tree matches
that of the code tree to make it obvious where to find tests for a
given module.  A check is added to the pep8 job to protect against
regressions.

The plugin test paths are relocated to neutron/tests/unit/plugins
but are otherwise ignored for now.

Change-Id: If307593259139171be21a71c58e3a34bf148cc7f
Partial-Bug: #1440834
8 years ago