¡@

Home 

OpenStack Study: 51b4de912379_cisco_nexus_ml2_mech.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(

        'cisco_ml2_nexusport_bindings',

        sa.Column('binding_id', sa.Integer(), nullable=False),

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

        sa.Column('vlan_id', sa.Integer(), autoincrement=False,

                  nullable=False),

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

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

        sa.PrimaryKeyConstraint('binding_id'),

    )

    op.create_table(

        'cisco_ml2_credentials',

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

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

        sa.Column('credential_name', sa.String(length=255), nullable=False),

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

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

        sa.PrimaryKeyConstraint('tenant_id', 'credential_name'),

    )

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.drop_table('cisco_ml2_credentials')

    op.drop_table('cisco_ml2_nexusport_bindings')