def upgrade(migrate_engine):
    print("003 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_template_table(meta),
              define_host_template_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    print("001 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_hosts_table(meta),
              define_discover_hosts_table(meta),
              define_clusters_table(meta),
              define_cluster_hosts_table(meta),
              define_networks_table(meta),
              define_ip_ranges_table(meta),
              define_host_interfaces_table(meta),
              define_config_sets_table(meta),
              define_components_table(meta),
              define_services_table(meta),
              define_roles_table(meta),
              define_host_roles_table(meta),
              define_service_roles_table(meta),
              define_config_files_table(meta),
              define_configs_table(meta),
              define_config_set_items_table(meta),
              define_config_historys_table(meta),
              define_tasks_table(meta),
              define_task_infos_table(meta),
              define_repositorys_table(meta),
              define_users_table(meta),
              define_versions_table(meta),
              define_assigned_networks_table(meta),
              define_logic_networks_table(meta),
              define_routers_table(meta),
              define_subnets_table(meta),
              define_float_ip_ranges_table(meta),
              define_dns_nameservers_table(meta),
              define_service_disks_table(meta),
              define_cinder_volumes_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    print("038 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_tasks_table(meta),
              define_task_infos_table(meta)]
    drop_tables(tables)
    create_tables(tables)
def upgrade(migrate_engine):
    print("022 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [
        define_optical_switchs_table(meta),
    ]
    create_tables(tables)
예제 #5
0
def upgrade(migrate_engine):
    print("040 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_cluster_versions_table(meta)]
    Table('targets', meta, autoload=True)
    Table('versions', meta, autoload=True)
    Table('clusters', meta, autoload=True)
    create_tables(tables)
def upgrade(migrate_engine):
    print("040 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_cluster_versions_table(meta)]
    Table('targets', meta, autoload=True)
    Table('versions', meta, autoload=True)
    Table('clusters', meta, autoload=True)
    create_tables(tables)
def upgrade(migrate_engine):
    print("042 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_template_config_roles_table(meta)]
    create_tables(tables)

    configs = Table('configs', meta, autoload=True)
    template_config_id_reserve = getattr(configs.c, 'template_config_id')
    template_config_id_reserve.alter(type=String(80))

    template_config = Table('template_config', meta, autoload=True)
    id_reserve = getattr(template_config.c, 'id')
    id_reserve.alter(type=String(80))
    name_reserve = getattr(template_config.c, 'name')
    name_reserve.alter(type=String(128))

    template_func = Table('template_func', meta, autoload=True)
    id_reserve = getattr(template_func.c, 'id')
    id_reserve.alter(type=String(80))
    name_reserve = getattr(template_func.c, 'name')
    name_reserve.alter(type=String(128))

    template_func_configs = Table('template_func_configs', meta, autoload=True)
    id_reserve = getattr(template_func_configs.c, 'func_id')
    id_reserve.alter(type=String(80))
    name_reserve = getattr(template_func_configs.c, 'config_id')
    name_reserve.alter(type=String(80))

    config_service = Table('config_service', meta, autoload=True)
    config_id_reserve = getattr(config_service.c, 'config_id')
    config_id_reserve.alter(type=String(80))

    session = orm.sessionmaker(bind=migrate_engine)()
    session.query(models.TemplateService).\
        filter(models.TemplateService.service_name == "compute").\
        update({"service_name": "openstack-nova-compute"})
    template_config_roles_count = session.query(
        models.TemplateConfigRoles).count()
    if not template_config_roles_count:
        session.add_all([
            models.TemplateConfigRoles(id=str(uuid.uuid4()),
                                       config_id='001',
                                       role_name="COMPUTER"),
            models.TemplateConfigRoles(id=str(uuid.uuid4()),
                                       config_id='002',
                                       role_name="COMPUTER"),
            models.TemplateConfigRoles(id=str(uuid.uuid4()),
                                       config_id='003',
                                       role_name="COMPUTER"),
            models.TemplateConfigRoles(id=str(uuid.uuid4()),
                                       config_id='003',
                                       role_name="COMPUTER"),
        ])
    session.commit()
def upgrade(migrate_engine):
    print("036 upgrade")
    if migrate_engine.name == "mysql":
        sql1 = "alter table host_templates modify column hosts longtext;"
        sql2 = "alter table template modify column hosts longtext;"
        migrate_engine.execute(sql1+sql2)
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_component_config_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    print("016 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_version_patch_table(meta), ]
    create_tables(tables)

    hosts = Table('hosts', meta, autoload=True)
    hosts.create_column(version_patch_id)
    clusters = Table('clusters', meta, autoload=True)
    clusters.create_column(target_system)
예제 #10
0
def upgrade(migrate_engine):
    print("039 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    Table('hosts', meta, autoload=True)
    tables = [define_logical_volume_table(meta)]
    create_tables(tables)

    conn = migrate_engine.connect()
    compatible_role_table(conn)
    compatible_service_disk_table(conn)
    conn.close()
def upgrade(migrate_engine):
    print("039 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    Table('hosts', meta, autoload=True)
    tables = [define_logical_volume_table(meta)]
    create_tables(tables)

    conn = migrate_engine.connect()
    compatible_role_table(conn)
    compatible_service_disk_table(conn)
    conn.close()
예제 #12
0
def upgrade(migrate_engine):
    print("044 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tasks = Table('tasks', meta, autoload=True)
    Table('hosts', meta, autoload=True)
    tasks_status_reserve = getattr(tasks.c, 'status')
    tasks_status_reserve.alter(name='cur_step')
    tasks_status_reserve.alter(nullable=True)
    tasks.create_column(targets)
    tasks.create_column(status)
    tables = [define_task_host_table(meta)]
    create_tables(tables)
예제 #13
0
def upgrade(migrate_engine):
    print("011 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_hwm_table(meta), ]
    create_tables(tables)

    hosts = Table('hosts', meta, autoload=True)
    hosts.create_column(hwm_id)
    hosts.create_column(host_hwm_ip)

    clusters = Table('clusters', meta, autoload=True)
    clusters.create_column(cluster_hwm_ip)
def upgrade(migrate_engine):
    print("018 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_template_config_table(meta),
              define_template_func_table(meta),
              define_template_func_configs_table(meta),
              define_template_service_table(meta),
              define_config_service_table(meta)]
    create_tables(tables)

    configs = Table('configs', meta, autoload=True)
    configs.create_column(template_config_id)
예제 #15
0
def upgrade(migrate_engine):
    print("016 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [
        define_version_patch_table(meta),
    ]
    create_tables(tables)

    hosts = Table('hosts', meta, autoload=True)
    hosts.create_column(version_patch_id)
    clusters = Table('clusters', meta, autoload=True)
    clusters.create_column(target_system)
def upgrade(migrate_engine):
    print("011 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [
        define_hwm_table(meta),
    ]
    create_tables(tables)

    hosts = Table('hosts', meta, autoload=True)
    hosts.create_column(hwm_id)
    hosts.create_column(host_hwm_ip)

    clusters = Table('clusters', meta, autoload=True)
    clusters.create_column(cluster_hwm_ip)
def upgrade(migrate_engine):
    print("037 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_host_versions_table(meta),
              define_targets_table(meta),
              define_target_status_table(meta)]

    versions = Table('versions', meta, autoload=True)
    Table('hosts', meta, autoload=True)
    Table('version_patchs', meta, autoload=True)
    create_tables(tables)
    versions.create_column(target_id)
    target_info = create_targets(migrate_engine)
    update_versions(migrate_engine, target_info)
    compatible_status(migrate_engine, target_info)
    compatible_host_versions(migrate_engine)
예제 #18
0
def upgrade(migrate_engine):
    print("037 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [
        define_host_versions_table(meta),
        define_targets_table(meta),
        define_target_status_table(meta)
    ]

    versions = Table('versions', meta, autoload=True)
    Table('hosts', meta, autoload=True)
    Table('version_patchs', meta, autoload=True)
    create_tables(tables)
    versions.create_column(target_id)
    target_info = create_targets(migrate_engine)
    update_versions(migrate_engine, target_info)
    compatible_status(migrate_engine, target_info)
    compatible_host_versions(migrate_engine)
def upgrade(migrate_engine):
    print("033 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_neutron_backend_table(meta), ]
    create_tables(tables)
def upgrade(migrate_engine):
    print("035 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_host_patch_history_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    print("003 upgrade")
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_template_table(meta), define_host_template_table(meta)]
    create_tables(tables)