def configure_db(conf):
    global _ENGINE, sa_logger, logger
    if not _ENGINE:
        conf.register_opts(db_opts)
        timeout = conf.sql_idle_timeout
        sql_connection = conf.sql_connection
        try:
            _ENGINE = create_engine(sql_connection, pool_recycle=timeout)
        except Exception, err:
            msg = _("Error configuring registry database with supplied "
                    "sql_connection '%(sql_connection)s'. "
                    "Got error:\n%(err)s") % locals()
            logger.error(msg)
            raise

        sa_logger = logging.getLogger('sqlalchemy.engine')
        if conf.debug:
            sa_logger.setLevel(logging.DEBUG)
        elif conf.verbose:
            sa_logger.setLevel(logging.INFO)

        models.register_models(_ENGINE)
Establish the database, create an engine if needed, and
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/registry/db/api.py/configure_db