Use a %% to escape the % sign

If the password contains character such as "!" and is changed to "%21",
"ValueError: invalid interpolation syntax" errors are occurring.

Closes-Bug: #2081695
Change-Id: Iaef6f937a7f0e8695fb53b14e6eb9a76d58657e1
This commit is contained in:
chung00-lee authored and LeeChunghwan committed 2025-04-23 20:56:48 +00:00
1 parent 46ba4f455d
commit 7a5ad06823
1 file changed
+2 -1
+2 -1
View File
@@ -76,7 +76,8 @@ def _find_alembic_conf():
config = alembic_config.Config(os.path.abspath(path))
config.set_main_option('sqlalchemy.url', CONF.database.connection)
conf_database_connection = str(CONF.database.connection).replace('%', '%%')
config.set_main_option('sqlalchemy.url', str(conf_database_connection))
# we don't want to use the logger configuration from the file, which is
# only really intended for the CLI