• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python migration.should_run函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: downgrade

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

    op.create_table(
        'ofp_server',
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('address', sa.String(length=255)),
        sa.Column('host_type', sa.String(length=255)),
        sa.PrimaryKeyConstraint(u'id')
    )
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:11,代码来源:49332180ca96_ryu_plugin_update.py


示例17: upgrade

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

    op.create_table(
        'portbindingports',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('host', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id')
    )
开发者ID:Apsu,项目名称:quantum,代码行数:11,代码来源:176a85fc7d79_add_portbindings_db.py


示例18: 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('portlocations',
                    sa.Column('port_id', sa.String(length=255),
                              primary_key=True, nullable=False),
                    sa.Column('host_id',
                              sa.String(length=255), nullable=False)
                    )
开发者ID:DestinyOneSystems,项目名称:quantum,代码行数:11,代码来源:3cabb850f4a5_table_to_track_port_.py


示例19: downgrade

def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return
    op.alter_column('nvp_network_bindings', 'phy_uuid',
                    name='tz_uuid',
                    existing_type=sa.String(36),
                    existing_nullable=True)
    op.alter_column('nvp_network_bindings', 'binding_type',
                    type_=sa.Enum('flat', 'vlan', 'stt', 'gre',
                                  name='nvp_network_bindings_binding_type'),
                    existing_nullable=True)
开发者ID:fuzht,项目名称:quantum,代码行数:11,代码来源:1341ed32cc1e_nvp_netbinding_update.py


示例20: upgrade

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

    op.create_table(
        'maclearningstates',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('mac_learning_enabled', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(
        ['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id'))
开发者ID:DestinyOneSystems,项目名称:quantum,代码行数:11,代码来源:3cbf70257c28_nvp_mac_learning.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python extensions.PluginAwareExtensionManager类代码示例发布时间:2022-05-26
下一篇:
Python api.validate_port_ownership函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap