Comment 5 for bug 1743120

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/533797
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ef6f4e4c8ec82e2c9f9988fe2e04591ee01220e6
Submitter: Zuul
Branch: master

commit ef6f4e4c8ec82e2c9f9988fe2e04591ee01220e6
Author: Chris Dent <email address hidden>
Date: Mon Jan 15 20:58:48 2018 +0000

    Refactor WSGI apps and utils to limit imports

    The file nova/api/openstack/__init__.py had imported a lot of
    modules, notably nova.utils. This means that any code which
    runs within that package, notably the placement service, imports
    all those modules, even if it is not going to use them. This
    results in scripts/binaries that are heavier than they need
    to be and in some cases including modules, like eventlet, that
    it would feel safe to not have in the stack.

    Unfortunately we cannot sinply rename nova/api/openstack/__init__.py
    to another name because it contains FaultWrapper and FaultWrapper
    is referred to, by package path, from the paste.ini file and that
    file is out there in config land, and something we prefer not to
    change. Therefore alternate methods of cleaning up were explored
    and this has led to some useful changes:

    Fault wrapper is the only consumer of walk_class_hierarchy so
    there is no reason for it it to be in nova.utils.

    nova.wsgi contains a mismash of WSGI middleware and applications,
    which need only a small number of imports, and Server classes
    which are more complex and not required by the WSGI wares.

    Therefore nova.wsgi was split into nova.wsgi and nova.api.wsgi.
    The name choices may not be ideal, but they were chosen to limit
    the cascades of changes that are needed across code and tests.

    Where utils.utf8 was used it has been replaced with the similar (but not
    exactly equivalient) method from oslo_utils.encodeutils.

    Change-Id: I297f30aa6eb01fe3b53fd8c9b7853949be31156d
    Partial-Bug: #1743120