Do not use "private" attribute in AuthTokenMiddleware

There is a convention that is followed Python code, a name prefixed
with an underscore should be treated as a non-public part of the API
It should be considered an implementation detail and subject to
change without notice. This patch removes usage of "_app" attribute
of base class from AuthTokenMiddleware.

Change-Id: I8d7fa42796ccfd0173335c1d515c789bf2be965b
This commit is contained in:
Yuriy Zveryanskyy
2015-06-24 11:50:07 +03:00
parent a31fc652e0
commit f0f1923078
+2 -1
View File
@@ -32,6 +32,7 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
"""
def __init__(self, app, conf, public_api_routes=[]):
self._ironic_app = app
# TODO(mrda): Remove .xml and ensure that doesn't result in a
# 401 Authentication Required instead of 404 Not Found
route_pattern_tpl = '%s(\.json|\.xml)?$'
@@ -57,6 +58,6 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
self.public_api_routes))
if env['is_public_api']:
return self._app(env, start_response)
return self._ironic_app(env, start_response)
return super(AuthTokenMiddleware, self).__call__(env, start_response)