Jump to: navigation, search

Blueprint-flagged-module-loading

Revision as of 05:47, 1 November 2010 by VishvanandaIshaya (talk)

We currently use utils.LazyPluggable and utils.import_class to load classes. We should use a single method. I suggest we use the techniques of LazyPluggable, but modify it so we don't need to specify a list of backends, but can give a class reference like those used in import_class. This way we get the lazy-loading of the backend, so that we can be less concerned with order of operations such as loading flags, and we don't need to maintain a list of possible values and can even reverence classes in other packages and allow drivers to be written outside of the main nova source tree.

Currently, nova uses at least four different methods for lazy loading components:

utils.load_object (managers and drivers) utils.load_class (auth manager) utils.LazyPluggable (db backend) switch statement (virt connections)

All of them start with a flag. There is no reason to have four different ways of delayed object loading.