Comment 5 for bug 1515326

Revision history for this message
Mike Bayer (zzzeek) wrote :

Here's the bug in Nova.

First, they are calling upon the private _factory member inappropriately:

def get_engine(use_slave=False):
    return main_context_manager._factory.get_legacy_facade().get_engine(
        use_slave=use_slave)

def get_api_engine():
    return api_context_manager._factory.get_legacy_facade().get_engine()

def get_session(use_slave=False, **kwargs):
    return main_context_manager._factory.get_legacy_facade().get_session(
        use_slave=use_slave, **kwargs)

So that a LegacyEngineFacade is created without actually initializing the factory. Then, the code that's failing here fails to call the configure() function, which would establish the factory with engine parameters.

In oslo.db I can add a more descriptive exception message but you'd still get an error, and this error doesn't know about Nova having a function called "configure()" either.