¡@

Home 

OpenStack Study: 492a106273f8_brocade_ml2_mech_dri.py

OpenStack Index

**** CubicPower OpenStack Study ****

def upgrade(active_plugins=None, options=None):

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.create_table(

        'ml2_brocadenetworks',

        sa.Column('id', sa.String(length=36), nullable=False),

        sa.Column('vlan', sa.String(length=10), nullable=True),

        sa.Column('segment_id', sa.String(length=36), nullable=True),

        sa.Column('network_type', sa.String(length=10), nullable=True),

        sa.Column('tenant_id', sa.String(length=255), nullable=True),

        sa.PrimaryKeyConstraint('id'))

    op.create_table(

        'ml2_brocadeports',

        sa.Column('id', sa.String(length=36), nullable=False),

        sa.Column('network_id', sa.String(length=36), nullable=False),

        sa.Column('admin_state_up', sa.Boolean()),

        sa.Column('physical_interface', sa.String(length=36), nullable=True),

        sa.Column('vlan_id', sa.String(length=36), nullable=True),

        sa.Column('tenant_id', sa.String(length=255), nullable=True),

        sa.PrimaryKeyConstraint('id'))

**** CubicPower OpenStack Study ****

def downgrade(active_plugins=None, options=None):

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.drop_table('ml2_brocadenetworks')

    op.drop_table('ml2_brocadeports')