¡@

Home 

OpenStack Study: 14f24494ca31_arista_ml2.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(

        'arista_provisioned_nets',

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

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

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

        sa.Column('segmentation_id', sa.Integer(),

                  autoincrement=False, nullable=True),

        sa.PrimaryKeyConstraint('id'))

    op.create_table(

        'arista_provisioned_vms',

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

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

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

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

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

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

        sa.PrimaryKeyConstraint('id'))

    op.create_table(

        'arista_provisioned_tenants',

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

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

        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('arista_provisioned_tenants')

    op.drop_table('arista_provisioned_vms')

    op.drop_table('arista_provisioned_nets')