¡@

Home 

OpenStack Study: 128e042a2b68_ext_gw_mode.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.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")

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.drop_column('routers', 'enable_snat')