"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/server/flask/application.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

application.py  (keystone-16.0.1):application.py  (keystone-17.0.0)
skipping to change at line 22 skipping to change at line 22
from __future__ import absolute_import from __future__ import absolute_import
import functools import functools
import sys import sys
import flask import flask
import oslo_i18n import oslo_i18n
from oslo_log import log from oslo_log import log
from oslo_middleware import healthcheck from oslo_middleware import healthcheck
import six
try: try:
# werkzeug 0.15.x # werkzeug 0.15.x
from werkzeug.middleware import dispatcher as wsgi_dispatcher from werkzeug.middleware import dispatcher as wsgi_dispatcher
except ImportError: except ImportError:
# werkzeug 0.14.x # werkzeug 0.14.x
import werkzeug.wsgi as wsgi_dispatcher import werkzeug.wsgi as wsgi_dispatcher
import keystone.api import keystone.api
from keystone import exception from keystone import exception
skipping to change at line 84 skipping to change at line 83
# TODO(adriant): register this with its own specific handler: # TODO(adriant): register this with its own specific handler:
if isinstance(error, exception.InsufficientAuthMethods): if isinstance(error, exception.InsufficientAuthMethods):
return receipt_handlers.build_receipt(error) return receipt_handlers.build_receipt(error)
# Handle logging # Handle logging
if isinstance(error, exception.Unauthorized): if isinstance(error, exception.Unauthorized):
LOG.warning( LOG.warning(
"Authorization failed. %(exception)s from %(remote_addr)s", "Authorization failed. %(exception)s from %(remote_addr)s",
{'exception': error, 'remote_addr': flask.request.remote_addr}) {'exception': error, 'remote_addr': flask.request.remote_addr})
elif isinstance(error, exception.UnexpectedError): elif isinstance(error, exception.UnexpectedError):
LOG.exception(six.text_type(error)) LOG.exception(str(error))
else: else:
LOG.warning(six.text_type(error)) LOG.warning(str(error))
# Render the exception to something user "friendly" # Render the exception to something user "friendly"
error_message = error.args[0] error_message = error.args[0]
message = oslo_i18n.translate(error_message, _best_match_language()) message = oslo_i18n.translate(error_message, _best_match_language())
if message is error_message: if message is error_message:
# translate() didn't do anything because it wasn't a Message, # translate() didn't do anything because it wasn't a Message,
# convert to a string. # convert to a string.
message = six.text_type(message) message = str(message)
body = dict( body = dict(
error={ error={
'code': error.code, 'code': error.code,
'title': error.title, 'title': error.title,
'message': message} 'message': message}
) )
if isinstance(error, exception.AuthPluginException): if isinstance(error, exception.AuthPluginException):
body['error']['identity'] = error.authentication body['error']['identity'] = error.authentication
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)