OpenStack resource provider inventory allocation service
Go to file
Chris Dent 8a3e7c5a95 Provide framework for setting placement error codes
The API-sig has a guideline[1] for including error codes in error
responses to help distinguish errors with the same status code
from one another. This change provides a simplest-thing-that-could-
possibly-work solution to make that go.

This solution comes about after a few different constraints and attempts:

* We would prefer to go on using the existing webob.exc exceptions, not
  make subclasses.
* We already have a special wrapper around our wsgi apps to deal with
  setting the json_error_formatter.
* Though webob allows custom Request and Response objects, it uses the
  default Response object as the parent of the HTTP exceptions.
* The Response object accepts kwargs, but only if they can be associated
  with known attributes on the class. Since we can't subclass...
* The json_error_formatter method is not passed the raw exception, but
  it does get the current WSGI environ
* The webob.exc classes take a 'comment' kwarg that is not used, but
  is also not passed to the json_error_formatter.

Therefore, when we raise an exception, we can set 'comment' to a code
and then assign that comment to a well known field in the environ and if
that environ is set in json_error_formatter, we can set 'code' in the
output.

This is done in a new microversion, 1.23. Every response gets a default
code 'placement.undefined_code' from 1.23 on. Future development will
add specific codes where required. This change adds a stub code for
inventory in use when doing a PUT to .../inventories but the name
may need improvement.

[1] http://specs.openstack.org/openstack/api-wg/guidelines/errors.html

Implements blueprint placement-api-error-handling

Change-Id: I9a833aa35d474caa35e640bbad6c436a3b16ac5e
2018-04-14 13:45:54 +01:00
api-ref/source Merge "Clean up metadata param in doc" 2017-04-03 12:39:18 +00:00
doc Provide framework for setting placement error codes 2018-04-14 13:45:54 +01:00
etc/nova Add reference to policy sample 2018-01-09 07:49:26 +00:00
gate Make nova-manage db purge take --all-cells 2018-03-08 09:26:49 -08:00
nova Provide framework for setting placement error codes 2018-04-14 13:45:54 +01:00
placement-api-ref/source [placement] Support forbidden traits in API 2018-04-13 19:24:08 +01:00
releasenotes/notes Provide framework for setting placement error codes 2018-04-14 13:45:54 +01:00
tools tox: make it possible to run pep8 on current patch only 2015-07-24 16:15:38 +01:00
.coveragerc Remove nova/openstack/* from .coveragerc 2016-10-12 16:20:49 -04:00
.gitignore Fix test runner config issues with os-testr 1.0.0 2017-09-13 17:11:57 -04:00
.gitreview Add .gitreview config file for gerrit. 2011-10-24 15:07:19 -04:00
.stestr.conf Finish stestr migration 2017-11-24 16:51:12 -05:00
.zuul.yaml Remove the branch specifier from the nova-multiattach job 2018-04-12 10:55:48 -04:00
babel.cfg Get rid of distutils.extra. 2012-02-08 19:30:39 -08:00
bindep.txt Merge "Bindep does not catch missing libpcre3-dev on Ubuntu" 2018-02-14 07:31:09 +00:00
CONTRIBUTING.rst Update links in documents 2018-01-12 17:05:11 +08:00
HACKING.rst Removed unnecessary parantheses in yield statements 2018-03-07 16:44:36 +09:00
LICENSE initial commit 2010-05-27 23:05:26 -07:00
README.rst Docs: modernise links 2018-03-24 20:27:11 +08:00
requirements.txt uncap eventlet in nova 2018-04-11 21:35:49 +08:00
setup.cfg Follow the new PTI for document build 2018-03-16 14:39:36 +00:00
setup.py Updated from global requirements 2017-03-02 11:50:48 +00:00
test-requirements.txt Updated from global requirements 2018-03-23 07:40:46 +00:00
tox.ini Default to py3 for the pep8 tox env because it's stricter 2018-04-04 15:24:00 +00:00

Team and repository tags

image

OpenStack Nova

OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of compute technologies, including: libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, XenServer, OpenStack Ironic and PowerVM.

Use the following resources to learn more.

API

To learn how to use Nova's API, consult the documentation available online at:

For more information on OpenStack APIs, SDKs and CLIs in general, refer to:

Operators

To learn how to deploy and configure OpenStack Nova, consult the documentation available online at:

In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:

Developers

For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst.

Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests.

Further developer focused documentation is available at:

Other Information

During each Summit and Project Team Gathering, we agree on what the whole community wants to focus on for the upcoming release. The plans for nova can be found at: