"Fossies" - the Fresh Open Source Software Archive

Member "octavia-3.0.2/octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py" (19 Dec 2018, 1240 Bytes) of package /linux/misc/openstack/octavia-3.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "48660b6643f0_add_new_states_for_amphora.py" see the Fossies "Dox" file reference documentation.

    1 # Copyright 2014 Hewlett-Packard Development Company, L.P.
    2 #
    3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    4 # not use this file except in compliance with the License. You may obtain
    5 # a copy of the License at
    6 #
    7 # http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 # Unless required by applicable law or agreed to in writing, software
   10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   12 # License for the specific language governing permissions and limitations
   13 # under the License.
   14 #
   15 
   16 """add new states for amphora
   17 
   18 Revision ID: 48660b6643f0
   19 Revises: 3e5b37a0bdb9
   20 Create Date: 2015-01-20 13:31:30.017959
   21 
   22 """
   23 
   24 from alembic import op
   25 import sqlalchemy as sa
   26 from sqlalchemy import sql
   27 
   28 # revision identifiers, used by Alembic.
   29 revision = '48660b6643f0'
   30 down_revision = '3e5b37a0bdb9'
   31 
   32 
   33 def upgrade():
   34     insert_table = sql.table(
   35         u'provisioning_status',
   36         sql.column(u'name', sa.String),
   37         sql.column(u'description', sa.String)
   38     )
   39 
   40     op.bulk_insert(
   41         insert_table,
   42         [
   43             {'name': 'READY'},
   44             {'name': 'BOOTING'},
   45             {'name': 'ALLOCATED'}
   46         ]
   47     )