WIP: SQLA2: Fix connection.execute
Change-Id: I597eed6f24f13f96f78f6596e16b6edcff989a90
This commit is contained in:
parent
5a07a1ebc3
commit
179fbd1c3f
|
@ -65,7 +65,7 @@ def upgrade():
|
|||
|
||||
connection = op.get_bind()
|
||||
# Fetching all required info from existing cluster
|
||||
res = connection.execute(
|
||||
res = connection.execute(sa.text(
|
||||
"SELECT "
|
||||
"cluster.uuid, "
|
||||
"cluster.name, "
|
||||
|
@ -82,7 +82,7 @@ def upgrade():
|
|||
"cluster_template.flavor_id, "
|
||||
"cluster_template.image_id "
|
||||
"FROM cluster INNER JOIN cluster_template "
|
||||
"ON cluster.cluster_template_id=cluster_template.uuid"
|
||||
"ON cluster.cluster_template_id=cluster_template.uuid")
|
||||
)
|
||||
|
||||
results = res.fetchall()
|
||||
|
|
|
@ -33,11 +33,11 @@ def upgrade():
|
|||
default=False))
|
||||
# Populate existing cluster with the cluster template_id
|
||||
connection = op.get_bind()
|
||||
connection.execute(
|
||||
connection.execute(sa.text(
|
||||
"UPDATE cluster "
|
||||
"INNER JOIN cluster_template "
|
||||
"ON cluster_template.uuid=cluster.cluster_template_id "
|
||||
"SET cluster.master_lb_enabled=cluster_template.master_lb_enabled "
|
||||
"WHERE cluster_template.uuid=cluster.cluster_template_id and "
|
||||
"cluster.master_lb_enabled is NULL"
|
||||
"cluster.master_lb_enabled is NULL")
|
||||
)
|
||||
|
|
|
@ -41,10 +41,10 @@ def upgrade():
|
|||
# Populate existing nodegroups with the cluster stack_id
|
||||
connection = op.get_bind()
|
||||
|
||||
connection.execute(
|
||||
connection.execute(sa.text(
|
||||
"UPDATE nodegroup "
|
||||
"INNER JOIN cluster ON nodegroup.cluster_id=cluster.uuid "
|
||||
"SET nodegroup.stack_id=cluster.stack_id, "
|
||||
"nodegroup.status=cluster.status, nodegroup.version=0 "
|
||||
"WHERE nodegroup.cluster_id=cluster.uuid"
|
||||
"WHERE nodegroup.cluster_id=cluster.uuid")
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue