Include cisco plugin in migration plugins with ovs
Currently we have many migration files with missing cisco plugin in migrate_plugin when ovs is included.This causes missing tables when cisco plugin is enabled and migration is run. This fix should automatically include the cisco plugin if ovs is detected in the migrate_plugins. Change-Id: I4dedfbafe9b431e85255d5427766e22eed09ee5e Closes-Bug: #1292114
This commit is contained in:
@@ -14,9 +14,16 @@
|
|||||||
#
|
#
|
||||||
# @author: Mark McClain, DreamHost
|
# @author: Mark McClain, DreamHost
|
||||||
|
|
||||||
|
OVS_PLUGIN = ('neutron.plugins.openvswitch.ovs_neutron_plugin'
|
||||||
|
'.OVSNeutronPluginV2')
|
||||||
|
CISCO_PLUGIN = 'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||||
|
|
||||||
|
|
||||||
def should_run(active_plugins, migrate_plugins):
|
def should_run(active_plugins, migrate_plugins):
|
||||||
if '*' in migrate_plugins:
|
if '*' in migrate_plugins:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
if (CISCO_PLUGIN not in migrate_plugins and
|
||||||
|
OVS_PLUGIN in migrate_plugins):
|
||||||
|
migrate_plugins.append(CISCO_PLUGIN)
|
||||||
return set(active_plugins) & set(migrate_plugins)
|
return set(active_plugins) & set(migrate_plugins)
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ migration_for_plugins = [
|
|||||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||||
'neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin',
|
'neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin',
|
||||||
'neutron.plugins.cisco.network_plugin.PluginV2',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
from neutron.db import migration
|
from neutron.db import migration
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ down_revision = None
|
|||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
from neutron.db import migration
|
||||||
from neutron.db.migration.alembic_migrations import common_ext_ops
|
from neutron.db.migration.alembic_migrations import common_ext_ops
|
||||||
# NOTE: This is a special migration that creates a Folsom compatible database.
|
# NOTE: This is a special migration that creates a Folsom compatible database.
|
||||||
|
|
||||||
@@ -80,10 +81,10 @@ def upgrade(active_plugins=None, options=None):
|
|||||||
# general model
|
# general model
|
||||||
upgrade_base()
|
upgrade_base()
|
||||||
|
|
||||||
if set(active_plugins) & set(L3_CAPABLE):
|
if migration.should_run(active_plugins, L3_CAPABLE):
|
||||||
common_ext_ops.upgrade_l3()
|
common_ext_ops.upgrade_l3()
|
||||||
|
|
||||||
if set(active_plugins) & set(FOLSOM_QUOTA):
|
if migration.should_run(active_plugins, FOLSOM_QUOTA):
|
||||||
common_ext_ops.upgrade_quota(options)
|
common_ext_ops.upgrade_quota(options)
|
||||||
|
|
||||||
if PLUGINS['lbr'] in active_plugins:
|
if PLUGINS['lbr'] in active_plugins:
|
||||||
@@ -484,10 +485,10 @@ def downgrade(active_plugins=None, options=None):
|
|||||||
downgrade_brocade()
|
downgrade_brocade()
|
||||||
downgrade_linuxbridge()
|
downgrade_linuxbridge()
|
||||||
|
|
||||||
if set(active_plugins) & set(FOLSOM_QUOTA):
|
if migration.should_run(active_plugins, FOLSOM_QUOTA):
|
||||||
common_ext_ops.downgrade_quota(options)
|
common_ext_ops.downgrade_quota(options)
|
||||||
|
|
||||||
if set(active_plugins) & set(L3_CAPABLE):
|
if migration.should_run(active_plugins, L3_CAPABLE):
|
||||||
common_ext_ops.downgrade_l3()
|
common_ext_ops.downgrade_l3()
|
||||||
|
|
||||||
downgrade_base()
|
downgrade_base()
|
||||||
|
|||||||
Reference in New Issue
Block a user