storage: fix upgrade when password contains a %
oslo.config doesn't support %{} or %() variable interpolation while ConfigParser does. So when a password contains a '%', it's fine for oslo.config But the Python ConfigParser will raise the exception. Since alembic use ConfigParser and not oslo.config, we have to escape the url ourself. This is not a big deal since, we don't want alembic doing variable interpolation. Change-Id: If7bfe7f082f4352fb49992a2216f2dd5b8993711
This commit is contained in:
parent
359043dc77
commit
268c1e8e9e
|
@ -92,7 +92,7 @@ class Connection(base.Connection):
|
|||
cfg = config.Config(
|
||||
"%s/sqlalchemy/alembic/alembic.ini" % os.path.dirname(__file__))
|
||||
cfg.set_main_option('sqlalchemy.url',
|
||||
self.conf.database.connection)
|
||||
self.conf.database.connection.replace("%", "%%"))
|
||||
return cfg
|
||||
|
||||
def upgrade(self, nocreate=False):
|
||||
|
|
Loading…
Reference in New Issue