Comment 5 for bug 1695299

Revision history for this message
Aizuddin Zali (mymzbe) wrote :

From https://git.launchpad.net/glance/tree/glance/db/sqlalchemy/alembic_migrations/__init__.py master bracnh line 37.

config.set_main_option('sqlalchemy.url', str(engine.url))

This indeed an expected behaviour, quoting to alembic documentation (http://alembic.zzzcomputing.com/en/latest/api/config.html).

 set_main_option(name, value)

    Set an option programmatically within the ‘main’ section.

    This overrides whatever was in the .ini file.
    Parameters:

        name – name of the value
        value¶ – the value. Note that this value is passed to ConfigParser.set, which supports variable interpolation using pyformat (e.g. %(some_value)s). A raw percent sign not part of an interpolation symbol must therefore be escaped, e.g. %%. The given value may refer to another value already in the file using the interpolation format.