Skip to content

Commit 02f4235

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Adapt to SQLAlchemy 1.4"
2 parents 2e53c82 + 39a6177 commit 02f4235

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

nova/cmd/manage.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,16 @@ def cell0_default_connection():
706706
# worry about parsing and splitting a URL which could have special
707707
# characters in the password, which makes parsing a nightmare.
708708
url = sqla_url.make_url(connection)
709-
url.database = url.database + '_cell0'
709+
710+
# TODO(gibi): remove hasattr() conditional in favor of "url.set()"
711+
# when SQLAlchemy 1.4 is the minimum version in requirements
712+
if hasattr(url, "set"):
713+
url = url.set(database=url.database + '_cell0')
714+
else:
715+
# TODO(zzzeek): remove when SQLAlchemy 1.4
716+
# is the minimum version in requirements
717+
url.database = url.database + '_cell0'
718+
710719
return urlparse.unquote(str(url))
711720

712721
dbc = database_connection or cell0_default_connection()

0 commit comments

Comments
 (0)