NSX|V: Fix neutron lbaas migration

Previous migration to stein changed loadbalancers provisioning
status to ERROR if not found in the nsxv3 binding table.
This causes NSX-V loadbalancers to be in ERROr mode too.
This patch fixed the existing migration.

Change-Id: I1fb381c7b52907a78e5e0033784e3928e738fa5f
This commit is contained in:
asarfaty 2020-01-12 10:53:28 +02:00
parent 1e19e85693
commit de22c6bc27

View File

@ -30,9 +30,11 @@ down_revision = 'fc6308289aca'
def upgrade():
if (migration.schema_has_table('nsxv3_lbaas_loadbalancers') and
migration.schema_has_table('lbaas_loadbalancers')):
migration.schema_has_table('lbaas_loadbalancers') and
migration.schema_has_table('nsxv_lbaas_loadbalancer_bindings')):
# Mark as ERROR loadbalancers without nsx mapping
op.execute("UPDATE lbaas_loadbalancers "
"SET provisioning_status='ERROR' "
"WHERE id not in (SELECT loadbalancer_id FROM "
"nsxv3_lbaas_loadbalancers)")
"nsxv3_lbaas_loadbalancers) and id not in (SELECT "
"loadbalancer_id FROM nsxv_lbaas_loadbalancer_bindings)")