Commit Graph

8 Commits

Author SHA1 Message Date
Luigi Toscano f3fea3abb7 Fix Flask 2.1 compatibility, disable unstable job
Since Flask 2.1, the same blueprint cannot be registered multiple
times with different url_prefix values, unless the 'name' parameter
is set. Otherwise the following error is reported: "The same blueprint
cannot be registered with the same name. Use name= when registering
to specify a unique name."

At the same time, disable the openstack-ansible job,
which started to fail again, but at this point the priority
is to unblock the gates.

Change-Id: I50df2fec3fd312082a14ef2a5b6774a2515afb44
2022-04-15 17:17:48 +02:00
Jeremy Freudberg 9aab4b5e47 Switch make_json_error back to being a function
This was originally a function, and then I changed it to a dict because
Flask complained. Now Flask complains that is a dict, so change it back
to being a function.

Change-Id: Iec30b4cf5023be711ac070def00b77e91978d992
2018-07-11 10:44:45 -04:00
Corey Bryant 72b493a40e Use register_error_handler to register make_json_error
error_handler_spec[None] doesn't exist by default in flask
versions >= 1.0. It doesn't appear to be the right way to
register an error handler anyway, assuming that's what it is
doing. Use register_error_handler instead.

Change-Id: I6a56e1edf277c5652a876658f8cfbb5550a73ada
Story: 2002617
Task: 22246
2018-06-19 15:18:54 -04:00
Zuul ddfdb0c925 Merge "Fix Flask error_handler_spec" 2018-01-25 22:15:13 +00:00
Jeremy Freudberg b1503b36c4 Tweak Sahara to make version discovery easier
Or at least, tweak Sahara to be more accomodating to keystoneauth's way
of doing version discovery.

* Don't require auth to do version discovery
* Make project ID in URL optional for APIv1 (and also for APIv2, but
  don't go around advertising that... *wink*)

Change-Id: Idb6f734aee26cab5bd629963a66ba01c92760864
Closes-Bug: #1744350
2018-01-25 05:56:15 +00:00
Jeremy Freudberg 87e176f882 Fix Flask error_handler_spec
The error_handler_spec is supposed to be a dict of dict of dicts, but
we had it as a dict of dict of functions, for unknown (historical?)
reasons.

Fix that, so that errors which occur in the Sahara API, but are not
otherwise caught by `sahara.utils.api.Rest.route` get handled correctly
by Flask instead of leading to some arcane error far down the stack.

Change-Id: I1e9d5f3fa00308baa7eee101c1f3b5a666cae4aa
Closes-Bug: #1745236
2018-01-24 21:42:40 +00:00
Michael McCune a9137addb4 add initial v2 api
this change implements the initial v2 experimental api. it is
implemented as an optional series of class that can be configured
through the paste deploy configuration file.

* add wsgi auth validator
* add middleware router
* add v2 endpoints
* add v2 flask blueprint object
* add optional paste filter and composite
* add developer docs for v2 api

Change-Id: I74627c0879851b354b5043f8a6ff91bae8438bb1
Partial-Implements: bp v2-api-experimental-impl
2016-02-10 09:56:07 -05:00
Sergey Reshetnyak 64583e4b83 Use api-paste.ini for loading middleware
Changes:
* use api-paste.ini config for loading middleware
* refactoring middlewares to support loading via pastedeploy
* use debug middleware from oslo_middleware library instead log_exchange
  middleware

Closes-bug: #1503983
Closes-bug: #1361360

Change-Id: I444c1799ef53dbb19a601e51dd95cd8509fb1c0c
2015-10-13 16:04:22 +03:00