Commit Graph

9 Commits

Author SHA1 Message Date
Bence Romsics 6552b9a820 Make debug option of wsgi server configurable
Because in some deployments tracebacks in API responses are unwanted
for security reasons.

Change-Id: I8a2acea7393c369bfa7d7822f21b4d40d56d6739
Needed-By: https://review.opendev.org/c/openstack/neutron/+/818391
Partial-Bug: #1951429
2021-12-21 11:23:23 +00:00
Hervé Beraud d6f72ec70b Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I42e2fc25eaec2e79540c3ab60d8752141637f7b8
2020-06-02 20:40:55 +02:00
Duan Jiong d10c8fe38b Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I52be02c3db254f63bb37270fa504694431d7671b
2017-03-23 16:04:59 +08:00
lei zhang 4d168fea3d Fix some inconsistency in docstrings
According to http://docs.openstack.org/developer/hacking/#docstrings

Change-Id: I328884f0743d6bb57acd20cc8c4fc644ea8446e3
2016-01-06 15:01:09 +00:00
Elena Ezhova 1c763f2285 Add Bandit to tox for security static analysis
Bandit is a tool designed to find common security issues in
Python code. This change adds a bandit target to tox.ini.

The config file bandit.yaml was generated using bandit-config-generator

Run bandit:
    tox -e bandit

Change-Id: I3bd64e1e58d4dc460ce869c50818e9913fe1b9b8
2015-12-01 16:10:15 +03:00
Elena Ezhova 9d8acfb38e Add functionality for creating Unix domain WSGI servers
This change modifies WSGI Server to allow creating Unix sockets
along with ip sockets. This would allow consuming projects to use
wsgi.Server to start Unix domain WSGI servers too, and thus get
rid of duplicating code.

Change-Id: I3de23efcd661b95cce6bbd1aa2c94abf0c814dbe
2015-11-18 17:35:16 +03:00
Marian Horban 4bcebe06ae Logger name argument was added into wsgi.Server constructor
Change-Id: I0e272af93982975a40ff9059a0a91e3ca86e462f
2015-11-10 04:49:14 -05:00
Marian Horban 2e2940d1e1 WSGI module was corrected
1. Deprecated SSL options were added.
2. Server class become derived from service.ServiceBase.
3. InvalidInput message was wrapped with log translator.

Change-Id: Id99b77a4f45998c158de7aa5f93f0f4afd9b5f7e
2015-09-18 08:08:58 +00:00
Marian Horban 6dd3ad50b6 Added wsgi functionality
Because of copy-pasted wsgi functionality in projects(nova, cinder,
glance, etc.) it is added to oslo.service with perspective to remove
it from other projects.
DocImpact

Change-Id: If8840168f10cc3561f4f01e6d456d6b4fd1de8b5
2015-08-19 12:01:40 +00:00