Import filter and app into namespace correctly
The module used to simply "import swift", and then reference
the classes:
swift.common.middleware.catch_errors.CatchErrorsMiddleware
swift.proxy.server.Application
in order to very that the WSGI services loaded the proper filters and
apps.
However, those references only happen to work, as the WSGI loading
would properly import the rest of the path so that the namespace
reference would be okay. If the WSGI configuration were to change, or
if the behavior of WSGI broke, instead of of seeing the actual failure
condition, a module attribute error would result instead:
AttributeError: 'module' object has no attribute 'middleware'
The referenced names are now properly imported with this change to
avoid misleading error conditions.
Change-Id: Ifff4271bc5be1136bf17e4e5b291b01033d608db
Signed-off-by: Peter Portante <peter.portante@redhat.com>
This commit is contained in:
@@ -33,9 +33,11 @@ from urllib import quote
|
||||
|
||||
from eventlet import listen
|
||||
|
||||
import swift
|
||||
import mock
|
||||
|
||||
import swift.common.middleware.catch_errors
|
||||
import swift.proxy.server
|
||||
|
||||
from swift.common.swob import Request
|
||||
from swift.common import wsgi, utils, ring
|
||||
|
||||
|
||||
Reference in New Issue
Block a user