db: Wrap raw SQL query in sqlalchemy.text
Another change in SQLAlchemy 2.x. Change-Id: I31123c70c9664844181eeaaf9d0846a319af7c2c Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -244,7 +244,9 @@ def _resource_classes_sync(ctx):
|
|||||||
# of the resource class ids from the previous style of
|
# of the resource class ids from the previous style of
|
||||||
# managing them. In some mysql settings a 0 is the same as
|
# managing them. In some mysql settings a 0 is the same as
|
||||||
# "give me a default key".
|
# "give me a default key".
|
||||||
conn.execute("SET SESSION SQL_MODE='NO_AUTO_VALUE_ON_ZERO'")
|
conn.execute(
|
||||||
|
sa.text("SET SESSION SQL_MODE='NO_AUTO_VALUE_ON_ZERO'")
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
ctx.session.execute(ins, batch_args)
|
ctx.session.execute(ins, batch_args)
|
||||||
LOG.debug("Synced resource_classes from os_resource_classes: %s",
|
LOG.debug("Synced resource_classes from os_resource_classes: %s",
|
||||||
|
Reference in New Issue
Block a user