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:
Peter Portante
2013-11-14 13:56:47 -05:00
parent a73d5e4921
commit 4f6d89ab51

View File

@@ -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