当前位置: 首页>>代码示例>>Python>>正文


Python migration.should_run函数代码示例

本文整理汇总了Python中quantum.db.migration.should_run函数的典型用法代码示例。如果您正苦于以下问题:Python should_run函数的具体用法?Python should_run怎么用?Python should_run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了should_run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.add_column("routers", sa.Column("enable_snat", sa.Boolean(), nullable=False, default=True))
    # Set enable_snat to True for existing routers
    op.execute("UPDATE routers SET enable_snat=True")
开发者ID:habuka036,项目名称:quantum,代码行数:7,代码来源:128e042a2b68_ext_gw_mode.py

示例2: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "qosqueues",
        sa.Column("tenant_id", sa.String(length=255), nullable=True),
        sa.Column("id", sa.String(length=36), nullable=False),
        sa.Column("name", sa.String(length=255), nullable=True),
        sa.Column("default", sa.Boolean(), nullable=True),
        sa.Column("min", sa.Integer(), nullable=False),
        sa.Column("max", sa.Integer(), nullable=True),
        sa.Column("qos_marking", sa.Enum("untrusted", "trusted", name="qosqueues_qos_marking"), nullable=True),
        sa.Column("dscp", sa.Integer(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "networkqueuemappings",
        sa.Column("network_id", sa.String(length=36), nullable=False),
        sa.Column("queue_id", sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(["network_id"], ["networks.id"], ondelete="CASCADE"),
        sa.ForeignKeyConstraint(["queue_id"], ["qosqueues.id"], ondelete="CASCADE"),
        sa.PrimaryKeyConstraint("network_id"),
    )
    op.create_table(
        "portqueuemappings",
        sa.Column("port_id", sa.String(length=36), nullable=False),
        sa.Column("queue_id", sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(["port_id"], ["ports.id"], ondelete="CASCADE"),
        sa.ForeignKeyConstraint(["queue_id"], ["qosqueues.id"]),
        sa.PrimaryKeyConstraint("port_id", "queue_id"),
    )
开发者ID:habuka036,项目名称:quantum,代码行数:33,代码来源:45680af419f9_nvp_qos.py

示例3: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('portsecuritybindings')
    op.drop_table('networksecuritybindings')
开发者ID:Frostman,项目名称:quantum,代码行数:7,代码来源:1149d7de0cfa_port_security.py

示例4: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ofctenantmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcnetworkmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcportmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcfiltermappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
开发者ID:Frostman,项目名称:quantum,代码行数:32,代码来源:3b54bf9e29f7_nec_plugin_sharednet.py

示例5: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'servicetypes',
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'id', sa.String(36), nullable=False),
        sa.Column(u'name', sa.String(255), nullable=True),
        sa.Column(u'description', sa.String(255), nullable=True),
        sa.Column(u'default', sa.Boolean(),
                  autoincrement=False, nullable=False),
        sa.Column(u'num_instances', sa.Integer(),
                  autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(
        u'servicedefinitions',
        sa.Column(u'id', sa.String(36), nullable=False),
        sa.Column(u'service_class', sa.String(length=255),
                  nullable=False),
        sa.Column(u'plugin', sa.String(255), nullable=True),
        sa.Column(u'driver', sa.String(255), nullable=True),
        sa.Column(u'service_type_id', sa.String(36),
                  nullable=False),
        sa.ForeignKeyConstraint(['service_type_id'], [u'servicetypes.id'],
                                name=u'servicedefinitions_ibfk_1'),
        sa.PrimaryKeyConstraint(u'id', u'service_class', u'service_type_id'))
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:27,代码来源:48b6f43f7471_service_type.py

示例6: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('networkconnections')
    op.drop_table('networkgatewaydevices')
    op.drop_table('networkgateways')
开发者ID:Apsu,项目名称:quantum,代码行数:7,代码来源:363468ac592c_nvp_network_gw.py

示例7: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'networkdhcpagentbindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id')
    )
    op.create_table(
        'routerl3agentbindings',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('router_id', sa.String(length=36), nullable=True),
        sa.Column('l3_agent_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['l3_agent_id'], ['agents.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:26,代码来源:4692d074d587_agent_scheduler.py

示例8: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('networksecuritybindings',
                    sa.Column('network_id', sa.String(length=36),
                    nullable=False),
                    sa.Column('port_security_enabled', sa.Boolean(),
                    nullable=False),
                    sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                    ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('network_id'))
    op.create_table('portsecuritybindings',
                    sa.Column('port_id', sa.String(length=36),
                    nullable=False),
                    sa.Column('port_security_enabled', sa.Boolean(),
                    nullable=False),
                    sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
                    ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('port_id'))
    ### end Alembic commands ###

    # Copy network and port ids over to network|port(securitybindings) table
    # and set port_security_enabled to false as ip address pairs were not
    # configured in NVP originally.
    op.execute("INSERT INTO networksecuritybindings SELECT id as "
               "network_id, False as port_security_enabled from networks")
    op.execute("INSERT INTO portsecuritybindings SELECT id as port_id, "
               "False as port_security_enabled from ports")
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:30,代码来源:1149d7de0cfa_port_security.py

示例9: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'servicetypes',
        sa.Column(u'tenant_id', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'id', mysql.VARCHAR(length=36), nullable=False),
        sa.Column(u'name', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'description', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'default', mysql.TINYINT(display_width=1),
                  autoincrement=False, nullable=False),
        sa.Column(u'num_instances', mysql.INTEGER(display_width=11),
                  autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(
        u'servicedefinitions',
        sa.Column(u'id', mysql.VARCHAR(length=36), nullable=False),
        sa.Column(u'service_class', mysql.VARCHAR(length=255),
                  nullable=False),
        sa.Column(u'plugin', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'driver', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'service_type_id', mysql.VARCHAR(length=36),
                  nullable=False),
        sa.ForeignKeyConstraint(['service_type_id'], [u'servicetypes.id'],
                                name=u'servicedefinitions_ibfk_1'),
        sa.PrimaryKeyConstraint(u'id', u'service_class', u'service_type_id'))
开发者ID:ntoll,项目名称:quantum,代码行数:27,代码来源:48b6f43f7471_service_type.py

示例10: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'ml2_network_segments',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('network_type', sa.String(length=32), nullable=False),
        sa.Column('physical_network', sa.String(length=64), nullable=True),
        sa.Column('segmentation_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table(
        'ml2_vlan_allocations',
        sa.Column('physical_network', sa.String(length=64), nullable=False),
        sa.Column('vlan_id', sa.Integer(), autoincrement=False,
                  nullable=False),
        sa.Column('allocated', sa.Boolean(), autoincrement=False,
                  nullable=False),
        sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
    )
    op.create_table(
        'ml2_flat_allocations',
        sa.Column('physical_network', sa.String(length=64), nullable=False),
        sa.PrimaryKeyConstraint('physical_network')
    )
开发者ID:Apsu,项目名称:quantum,代码行数:30,代码来源:5ac71e65402c_ml2_initial.py

示例11: upgrade

def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table(u'port_bindings')
    op.drop_table(u'services_bindings')
    op.drop_table(u'portprofiles')
    op.drop_table(u'portprofile_bindings')
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:8,代码来源:2a6d0b51f4bb_cisco_plugin_cleanup.py

示例12: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('ofcfiltermappings')
    op.drop_table('ofcportmappings')
    op.drop_table('ofcnetworkmappings')
    op.drop_table('ofctenantmappings')
开发者ID:Frostman,项目名称:quantum,代码行数:8,代码来源:3b54bf9e29f7_nec_plugin_sharednet.py

示例13: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.rename_table(
        'subnetroutes',
        'routes',
    )
    op.drop_table('routerroutes')
开发者ID:Frostman,项目名称:quantum,代码行数:9,代码来源:1c33fa3cd1a1_extra_route_config.py

示例14: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ovs_tunnel_ips',
        sa.Column('ip_address', sa.String(length=255), nullable=False),
        sa.PrimaryKeyConstraint('ip_address')
    )
开发者ID:Apsu,项目名称:quantum,代码行数:9,代码来源:32b517556ec9_remove_tunnelip_mode.py

示例15: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table(u'poolstatisticss')
    op.drop_table(u'members')
    op.drop_table(u'healthmonitors')
    op.drop_table(u'pools')
    op.drop_table(u'sessionpersistences')
    op.drop_table(u'poolmonitorassociations')
    op.drop_table(u'vips')
开发者ID:Frostman,项目名称:quantum,代码行数:11,代码来源:54c2c487e913_lbaas.py


注:本文中的quantum.db.migration.should_run函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。