def _clear_facade(self): # This is for Pike if hasattr(sqla_api, '_FACADE'): sqla_api._FACADE = None # This is for Queens and Rocky (untested) elif hasattr(sqla_api, 'configure'): sqla_api.configure(volume_cmd.CONF)
def __init__(self): super().__init__() # NOTE(lhx_): oslo_db.enginefacade is configured in tests the same # way as it's done for any other services that uses the db global SESSION_CONFIGURED if not SESSION_CONFIGURED: sqla_api.configure(CONF) SESSION_CONFIGURED = True # Suppress logging for test runs migrate_logger = logging.getLogger('migrate') migrate_logger.setLevel(logging.WARNING)
def __init__(self, db_api, db_migrate, sql_connection): # NOTE(lhx_): oslo_db.enginefacade is configured in tests the same # way as it's done for any other services that uses the db global SESSION_CONFIGURED if not SESSION_CONFIGURED: sqla_api.configure(CONF) SESSION_CONFIGURED = True self.sql_connection = sql_connection # Suppress logging for test runs migrate_logger = logging.getLogger('migrate') migrate_logger.setLevel(logging.WARNING) self.engine = db_api.get_engine() self.engine.dispose() conn = self.engine.connect() db_migrate.db_sync() self._DB = "".join(line for line in conn.connection.iterdump()) self.engine.dispose()