~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2011 OpenStack LLC
2
 
# All Rights Reserved.
3
 
#
4
 
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
 
#    not use this file except in compliance with the License. You may obtain
6
 
#    a copy of the License at
7
 
#
8
 
#         http://www.apache.org/licenses/LICENSE-2.0
9
 
#
10
 
#    Unless required by applicable law or agreed to in writing, software
11
 
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
 
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 
#    License for the specific language governing permissions and limitations
14
 
#    under the License.
15
 
 
16
 
from sqlalchemy import Column, Integer, MetaData, String, Table
17
 
 
18
 
 
19
 
def upgrade(migrate_engine):
20
 
    # Upgrade operations go here. Don't create your own engine;
21
 
    # bind migrate_engine to your metadata
22
 
    meta = MetaData()
23
 
    meta.bind = migrate_engine
24
 
 
25
 
    fixed_ips = Table('fixed_ips', meta, autoload=True)
26
 
 
27
 
    #
28
 
    # New Columns
29
 
    #
30
 
    fixed_ips_addressV6 = Column(
31
 
        "addressV6",
32
 
        String(
33
 
            length=255,
34
 
            convert_unicode=False,
35
 
            assert_unicode=None,
36
 
            unicode_error=None,
37
 
            _warn_on_bytestring=False))
38
 
 
39
 
    fixed_ips_netmaskV6 = Column(
40
 
        "netmaskV6",
41
 
        String(
42
 
            length=3,
43
 
            convert_unicode=False,
44
 
            assert_unicode=None,
45
 
            unicode_error=None,
46
 
            _warn_on_bytestring=False))
47
 
 
48
 
    fixed_ips_gatewayV6 = Column(
49
 
        "gatewayV6",
50
 
        String(
51
 
            length=255,
52
 
            convert_unicode=False,
53
 
            assert_unicode=None,
54
 
            unicode_error=None,
55
 
            _warn_on_bytestring=False))
56
 
    # Add columns to existing tables
57
 
    fixed_ips.create_column(fixed_ips_addressV6)
58
 
    fixed_ips.create_column(fixed_ips_netmaskV6)
59
 
    fixed_ips.create_column(fixed_ips_gatewayV6)
60
 
 
61
 
 
62
 
def downgrade(migrate_engine):
63
 
    meta = MetaData()
64
 
    meta.bind = migrate_engine
65
 
 
66
 
    fixed_ips = Table('fixed_ips', meta, autoload=True)
67
 
 
68
 
    fixed_ips.drop_column('addressV6')
69
 
    fixed_ips.drop_column('netmaskV6')
70
 
    fixed_ips.drop_column('gatewayV6')