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

Python base.reflect_db_metadata函数代码示例

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

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



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

示例1: prepare

def prepare():
    meta = base.reflect_db_metadata()

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2015.1-8.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [],
                    'config': {}
                }
            })
        }]
    )
    releaseid = result.inserted_primary_key[0]

    db.execute(
        meta.tables['clusters'].insert(),
        [{
            'name': 'test_env',
            'release_id': releaseid,
            'mode': 'ha_compact',
            'status': 'new',
            'net_provider': 'neutron',
            'grouping': 'roles',
            'fuel_version': '8.0',
            'deployment_tasks': '[]',
            'replaced_deployment_info': '{}'
        }])

    db.commit()
开发者ID:ekorekin,项目名称:fuel-web,代码行数:35,代码来源:test_migration_fuel_9_0_1.py


示例2: prepare

def prepare():
    meta = base.reflect_db_metadata()

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2015.1-10.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'deployment_tasks': '{}',
            'roles': '{}',
            'roles_metadata': '{}',
            'is_deployable': True,
            'required_component_types': ['network', 'storage']
        }]
    )

    release_id = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['clusters'].insert(),
        [{
            'name': 'test',
            'release_id': release_id,
            'mode': 'ha_compact',
            'status': 'new',
            'net_provider': 'neutron',
            'grouping': 'roles',
            'fuel_version': '10.0',
        }]
    )
    cluster_id = result.inserted_primary_key[0]

    TestPluginLinksConstraints.prepare(meta, cluster_id)
开发者ID:sebrandon1,项目名称:fuel-web,代码行数:35,代码来源:test_downgrade_fuel_10_0.py


示例3: test_set_attributes

    def test_set_attributes(self):
        meta = base.reflect_db_metadata()
        bond_config = self.env.get_default_plugin_bond_config()
        self.env.create_plugin(
            name='plugin_a_with_bond_attributes',
            package_version='5.0.0',
            bond_attributes_metadata=bond_config)
        cluster = self._create_test_cluster(
            nodes=[{'roles': ['controller']}])

        bond_config.update({
            'type__': {'value': consts.BOND_TYPES.linux},
            'mode': {'value': {'value': consts.BOND_MODES.balance_rr}}})
        for node in cluster.nodes:
            nic_names = [iface.name for iface in node.nic_interfaces]
            self.env.make_bond_via_api(
                'lnx_bond', '', nic_names, node.id, attrs=bond_config)

        node_bond_interface_cluster_plugin = self.db.execute(
            meta.tables['node_bond_interface_cluster_plugins'].select()
        ).fetchall()[0]

        _id = node_bond_interface_cluster_plugin.id
        attributes = {'test_attr': 'a'}
        NodeBondInterfaceClusterPlugin.set_attributes(_id, attributes)

        node_bond_interface_cluster_plugin = self.db.execute(
            meta.tables['node_bond_interface_cluster_plugins'].select()
        ).fetchall()[0]

        self.assertDictEqual(
            attributes,
            jsonutils.loads(node_bond_interface_cluster_plugin[1]))
开发者ID:openstack,项目名称:fuel-web,代码行数:33,代码来源:test_object_plugin.py


示例4: prepare

def prepare():
    meta = base.reflect_db_metadata()

    releaseid = insert_table_row(
        meta.tables["releases"],
        {"name": "test_name", "version": "2014.2.2-6.1", "operating_system": "ubuntu", "state": "available"},
    )

    clusterid = insert_table_row(
        meta.tables["clusters"],
        {
            "name": "test_env",
            "release_id": releaseid,
            "mode": "ha_compact",
            "status": "new",
            "net_provider": "neutron",
            "grouping": "roles",
            "fuel_version": "6.1",
        },
    )

    db.execute(
        meta.tables["nodegroups"].insert(),
        [
            {"cluster_id": clusterid, "name": "test_nodegroup_a"},
            {"cluster_id": clusterid, "name": "test_nodegroup_a"},
            {"cluster_id": clusterid, "name": "test_nodegroup_b"},
            {"cluster_id": clusterid, "name": "test_nodegroup_b"},
        ],
    )

    db.commit()
开发者ID:ibelikov,项目名称:fuel-web,代码行数:32,代码来源:test_migration_fuel_8_0.py


示例5: test_add_nodes_for_cluster_plugin_with_empty_attributes

    def test_add_nodes_for_cluster_plugin_with_empty_attributes(self):
        meta = base.reflect_db_metadata()
        self.env.create_node(
            cluster_id=self.cluster.id,
            roles=['compute']
        )
        plugin = Plugin.create({
            'name': 'plugin_a_with_node_attributes',
            'title': 'Test Plugin',
            'package_version': '5.0.0',
            'version': '1.0.0',
            'node_attributes_metadata': {}
        })
        cluster_plugin = ClusterPlugin.create({
            'cluster_id': self.cluster.id,
            'plugin_id': plugin.id,
            'enabled': False,
            'attributes': plugin.node_attributes_metadata
        })

        NodeClusterPlugin.add_nodes_for_cluster_plugin(cluster_plugin)

        node_cluster_plugins = self.db.execute(
            meta.tables['node_cluster_plugins'].select()
        ).fetchall()
        self.assertEqual(0, len(node_cluster_plugins))
开发者ID:openstack,项目名称:fuel-web,代码行数:26,代码来源:test_object_plugin.py


示例6: test_add_cluster_plugin_for_node_bond

    def test_add_cluster_plugin_for_node_bond(self):
        meta = base.reflect_db_metadata()
        plugin_bond_config = self.env.get_default_plugin_bond_config()
        self.env.create_plugin(
            name='plugin_a_with_bond_attributes',
            package_version='5.0.0',
            bond_attributes_metadata=plugin_bond_config)
        self.env.create_plugin(
            name='plugin_b_with_bond_attributes',
            package_version='5.0.0',
            bond_attributes_metadata={})
        cluster = self._create_test_cluster(
            nodes=[{'roles': ['controller']}, {'roles': ['compute']}])
        bond_config = {
            'type__': {'value': consts.BOND_TYPES.linux},
            'mode': {'value': {'value': consts.BOND_MODES.balance_rr}}}
        for node in cluster.nodes:
            nic_names = [iface.name for iface in node.nic_interfaces]
            self.env.make_bond_via_api(
                'lnx_bond', '', nic_names, node.id, attrs=bond_config)

        node_bond_interface_cluster_plugins = self.db.execute(
            meta.tables['node_bond_interface_cluster_plugins'].select()
        ).fetchall()

        self.assertEqual(2, len(node_bond_interface_cluster_plugins))
        for item in node_bond_interface_cluster_plugins:
            self.assertDictEqual(
                plugin_bond_config, jsonutils.loads(item.attributes))
开发者ID:openstack,项目名称:fuel-web,代码行数:29,代码来源:test_object_plugin.py


示例7: get_master_node_settings

def get_master_node_settings():
    meta = base.reflect_db_metadata()
    master_node_settings_table = meta.tables['master_node_settings']

    settings = db.execute(sa.select(
        [master_node_settings_table.c.settings])).scalar()
    db().commit()
    return settings
开发者ID:ansumanbebarta,项目名称:fuel-web,代码行数:8,代码来源:test_migration_fuel_8_0.py


示例8: test_connect_to_cluster

 def test_connect_to_cluster(self):
     meta = base.reflect_db_metadata()
     self._create_test_plugins()
     self._create_test_cluster()
     cluster_plugins = self.db.execute(
         meta.tables['cluster_plugins'].select()
     ).fetchall()
     self.assertEqual(len(cluster_plugins), 5)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:8,代码来源:test_object_plugin.py


示例9: prepare

def prepare():
    meta = base.reflect_db_metadata()
    db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2015.1-8.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [],
                    'config': {}
                }
            }),
            'volumes_metadata': jsonutils.dumps({})
        }])

    db.execute(
        meta.tables['nodes'].insert(),
        [{
            'uuid': '26b508d0-0d76-4159-bce9-f67ec2765480',
            'cluster_id': None,
            'group_id': None,
            'status': 'discover',
            'meta': '{}',
            'mac': 'aa:aa:aa:aa:aa:aa',
            'timestamp': datetime.datetime.utcnow(),
        }]
    )

    db.execute(
        meta.tables['tasks'].insert(),
        [
            {
                'id': 55,
                'uuid': '219eaafe-01a1-4f26-8edc-b9d9b0df06b3',
                'name': 'deployment',
                'status': 'running',
                'deployment_info': jsonutils.dumps({})
            },
        ]
    )
    db.execute(
        meta.tables['deployment_history'].insert(),
        [
            {
                'uuid': 'fake_uuid_0',
                'deployment_graph_task_name': 'fake',
                'node_id': 'fake_node_id',
                'task_id': 55,
                'status': 'pending',
                'summary': jsonutils.dumps({'fake': 'fake'}),
            }
        ]
    )

    db.commit()
开发者ID:mmalchuk,项目名称:openstack-fuel-web,代码行数:58,代码来源:test_migration_fuel_9_0_2.py


示例10: test_set_plugin_attributes

    def test_set_plugin_attributes(self):
        meta = base.reflect_db_metadata()
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugin.get_connected_plugins(cluster).first()
        ClusterPlugin.set_attributes(cluster.id, plugin.id, enabled=True)

        columns = meta.tables["cluster_plugins"].c
        enabled = self.db.execute(
            sa.select([columns.enabled]).where(columns.cluster_id == cluster.id).where(columns.plugin_id == plugin.id)
        ).fetchone()
        self.assertTrue(enabled[0])
开发者ID:mmalchuk,项目名称:openstack-fuel-web,代码行数:13,代码来源:test_object_plugin.py


示例11: prepare

def prepare():
    meta = base.reflect_db_metadata()

    # Fill in migration table with data
    db.execute(
        meta.tables[extensions_migration_buffer_table_name].insert(),
        [{'extension_name': 'volume_manager',
          'data': jsonutils.dumps({'node_id': 1, 'volumes': [{'volume': 1}]})},
         {'extension_name': 'volume_manager',
          'data': jsonutils.dumps({'node_id': 2, 'volumes': [{'volume': 2}]})},
         {'extension_name': 'some_different_extension',
          'data': 'some_data'}])

    db.commit()
开发者ID:ekorekin,项目名称:fuel-web,代码行数:14,代码来源:test_migration_volume_manager_extension_001_add_volumes_table.py


示例12: test_populate_nic_with_empty_plugin_attributes

    def test_populate_nic_with_empty_plugin_attributes(self):
        # create cluster with 2 nodes
        # install plugin without nic attributes which compatible with cluster
        meta = base.reflect_db_metadata()
        self._create_test_cluster(
            nodes=[{'roles': ['controller']}, {'roles': ['compute']}])
        self.env.create_plugin(
            name='plugin_b_with_nic_attributes',
            package_version='5.0.0',
            nic_attributes_metadata={})

        node_nic_interface_cluster_plugins = self.db.execute(
            meta.tables['node_nic_interface_cluster_plugins'].select()
        ).fetchall()

        self.assertEqual(0, len(node_nic_interface_cluster_plugins))
开发者ID:openstack,项目名称:fuel-web,代码行数:16,代码来源:test_object_plugin.py


示例13: prepare

def prepare():
    meta = base.reflect_db_metadata()
    db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2015.1-8.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [],
                    'config': {}
                }
            }),
            'volumes_metadata': jsonutils.dumps({})
        }])
    db.commit()
开发者ID:pod2metra,项目名称:fuel-web,代码行数:18,代码来源:test_migration_fuel_9_0_2.py


示例14: test_populate_nic_with_plugin_attributes

    def test_populate_nic_with_plugin_attributes(self):
        # create cluster with 2 nodes
        # install plugin with nic attributes which compatible with cluster
        meta = base.reflect_db_metadata()
        nic_config = self.env.get_default_plugin_nic_config()
        self._create_test_cluster(
            nodes=[{'roles': ['controller']}, {'roles': ['compute']}])
        self.env.create_plugin(
            name='plugin_a_with_nic_attributes',
            package_version='5.0.0',
            nic_attributes_metadata=nic_config)

        node_nic_interface_cluster_plugins = self.db.execute(
            meta.tables['node_nic_interface_cluster_plugins'].select()
        ).fetchall()

        self.assertEqual(4, len(node_nic_interface_cluster_plugins))
        for item in node_nic_interface_cluster_plugins:
            self.assertDictEqual(nic_config, jsonutils.loads(item.attributes))
开发者ID:openstack,项目名称:fuel-web,代码行数:19,代码来源:test_object_plugin.py


示例15: prepare

def prepare():
    meta = base.reflect_db_metadata()

    roles_metadata = jsonutils.dumps({
        "mongo": {
            "name": "Mongo",
            "description": "Mongo role"
        }
    })

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2014.2-6.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'roles_metadata': roles_metadata,
            'attributes_metadata': jsonutils.dumps({
                'editable': {
                    'storage': {
                        'volumes_lvm': {},
                    },
                    'common': {},
                },
                'generated': {
                    'cobbler': {'profile': {
                        'generator_arg': 'ubuntu_1204_x86_64'}}},
            }),
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [
                        {
                            'assign_vip': True,
                        },
                    ]
                },
                'nova_network': {
                    'networks': [
                        {
                            'assign_vip': False,
                        },
                    ]
                },

            }),
            'is_deployable': True,
        }])
    releaseid = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['release_orchestrator_data'].insert(),
        [{
            'release_id': releaseid,
            'puppet_manifests_source': 'rsync://0.0.0.0:/puppet/manifests',
            'puppet_modules_source': 'rsync://0.0.0.0:/puppet/modules',
            'repo_metadata': jsonutils.dumps({
                'base': 'http://baseuri base-suite main',
                'test': 'http://testuri test-suite main',
            })
        }])

    result = db.execute(
        meta.tables['clusters'].insert(),
        [{
            'name': 'test_env',
            'release_id': releaseid,
            'mode': 'ha_compact',
            'status': 'new',
            'net_provider': 'neutron',
            'grouping': 'roles',
            'fuel_version': '6.0',
        }])
    clusterid = result.inserted_primary_key[0]

    db.execute(
        meta.tables['attributes'].insert(),
        [{
            'cluster_id': clusterid,
            'editable': '{"common": {}}',
            'generated': '{"cobbler": {"profile": "ubuntu_1204_x86_64"}}',
        }])

    db.execute(
        meta.tables['ip_addrs'].insert(),
        [{
            'ip_addr': '192.168.0.2',
        }])

    db.execute(
        meta.tables['network_groups'].insert(),
        [{
            'name': 'public',
            'release': releaseid,
            'meta': jsonutils.dumps({'assign_vip': True})
        }])

    db.commit()
开发者ID:SmartInfrastructures,项目名称:fuel-web-dev,代码行数:98,代码来源:test_migration_fuel_6_1.py


示例16: prepare

def prepare():
    meta = base.reflect_db_metadata()
    for release_name, env_version, cluster_name, uuid, mac in zip(
            ('release_1', 'release_2'),
            ('liberty-8.0', 'mitaka-9.0'),
            ('cluster_1', 'cluster_2'),
            ('fcd49872-3917-4a18-98f9-3f5acfe3fde',
             'fcd49872-3917-4a18-98f9-3f5acfe3fdd'),
            ('bb:aa:aa:aa:aa:aa', 'bb:aa:aa:aa:aa:cc')
    ):
        release = {
            'name': release_name,
            'version': env_version,
            'operating_system': 'ubuntu',
            'state': 'available',
            'networks_metadata': '{}',
            'attributes_metadata': jsonutils.dumps(ATTRIBUTES_METADATA),
            'deployment_tasks': '{}',
            'roles': jsonutils.dumps([
                'controller',
                'compute',
                'virt',
                'compute-vmware',
                'ironic',
                'cinder',
                'cinder-block-device',
                'cinder-vmware',
                'ceph-osd',
                'mongo',
                'base-os',
            ]),
            'roles_metadata': jsonutils.dumps({
                'controller': {
                    'name': 'Controller',
                },
                'compute': {
                    'name': 'Compute',
                },
                'virt': {
                    'name': 'Virtual',
                },
                'compute-vmware': {
                    'name': 'Compute VMware',
                },
                'ironic': {
                    'name': 'Ironic',
                },
                'cinder': {
                    'name': 'Cinder',
                },
                'cinder-block-device': {
                    'name': 'Cinder Block Device',
                },
                'cinder-vmware': {
                    'name': 'Cinder Proxy to VMware Datastore',
                },
                'ceph-osd': {
                    'name': 'Ceph OSD',
                },
                'mongo': {
                    'name': 'Telemetry - MongoDB',
                },
                'base-os': {
                    'name': 'Operating System',
                }
            }),
            'is_deployable': True,
            'vmware_attributes_metadata':
                jsonutils.dumps(VMWARE_ATTRIBUTES_METADATA)
        }
        result = db.execute(meta.tables['releases'].insert(), [release])
        release_id = result.inserted_primary_key[0]

        result = db.execute(
            meta.tables['clusters'].insert(),
            [{
                'name': cluster_name,
                'release_id': release_id,
                'mode': 'ha_compact',
                'status': 'new',
                'net_provider': 'neutron',
                'grouping': 'roles',
                'fuel_version': '9.0',
                'deployment_tasks': '{}'
            }])

        cluster_id = result.inserted_primary_key[0]
        editable = ATTRIBUTES_METADATA.get('editable', {})
        db.execute(
            meta.tables['attributes'].insert(),
            [{
                'cluster_id': cluster_id,
                'editable': jsonutils.dumps(editable)
            }]
        )
        db.execute(
            meta.tables['nodes'].insert(),
            [{
                'uuid': uuid,
                'cluster_id': cluster_id,
#.........这里部分代码省略.........
开发者ID:openstack,项目名称:fuel-web,代码行数:101,代码来源:test_migration_fuel_9_2.py


示例17: prepare

def prepare():
    meta = base.reflect_db_metadata()

    releaseid = insert_table_row(
        meta.tables['releases'],
        {
            'name': 'test_name',
            'version': '2014.2.2-6.1',
            'operating_system': 'ubuntu',
            'state': 'available',
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [],
                    'config': {}
                }
            })
        }
    )

    clusterid = insert_table_row(
        meta.tables['clusters'],
        {
            'name': 'test_env',
            'release_id': releaseid,
            'mode': 'ha_compact',
            'status': 'new',
            'net_provider': 'neutron',
            'grouping': 'roles',
            'fuel_version': '7.0',
        }
    )

    db.execute(
        meta.tables['nodegroups'].insert(),
        [
            {'cluster_id': clusterid, 'name': 'test_nodegroup_a'},
            {'cluster_id': clusterid, 'name': 'test_nodegroup_a'},
            {'cluster_id': clusterid, 'name': 'test_nodegroup_b'},
            {'cluster_id': clusterid, 'name': 'test_nodegroup_b'},
            {'cluster_id': clusterid, 'name': consts.NODE_GROUPS.default},
        ])

    netconfigid = insert_table_row(
        meta.tables['networking_configs'],
        {
            'cluster_id': None,
            'dns_nameservers': ['8.8.8.8'],
            'floating_ranges': [],
            'configuration_template': None,
        })

    db.execute(
        meta.tables['neutron_config'].insert(),
        [{
            'id': netconfigid,
            'vlan_range': [],
            'gre_id_range': [],
            'base_mac': '00:00:00:00:00:00',
            'internal_cidr': '10.10.10.00/24',
            'internal_gateway': '10.10.10.01',
            'segmentation_type': 'vlan',
            'net_l23_provider': 'ovs'
        }])

    result = db.execute(
        meta.tables['plugins'].insert(),
        [{
            'name': 'test_plugin_a',
            'title': 'Test plugin A',
            'version': '1.0.0',
            'description': 'Test plugin A for Fuel',
            'homepage': 'http://fuel_plugins.test_plugin.com',
            'package_version': '3.0.0',
            'groups': jsonutils.dumps(['tgroup']),
            'authors': jsonutils.dumps(['tauthor']),
            'licenses': jsonutils.dumps(['tlicense']),
            'releases': jsonutils.dumps([
                {'repository_path': 'repositories/ubuntu'}
            ]),
            'fuel_version': jsonutils.dumps(['6.1', '7.0']),
        }]
    )
    pluginid_a = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['plugins'].insert(),
        [{
            'name': 'test_plugin_b',
            'title': 'Test plugin B',
            'version': '1.0.0',
            'description': 'Test plugin B for Fuel',
            'homepage': 'http://fuel_plugins.test_plugin.com',
            'package_version': '3.0.0',
            'groups': jsonutils.dumps(['tgroup']),
            'authors': jsonutils.dumps(['tauthor']),
            'licenses': jsonutils.dumps(['tlicense']),
            'releases': jsonutils.dumps([
                {'repository_path': 'repositories/ubuntu'}
            ]),
            'fuel_version': jsonutils.dumps(['6.1', '7.0']),
#.........这里部分代码省略.........
开发者ID:ansumanbebarta,项目名称:fuel-web,代码行数:101,代码来源:test_migration_fuel_8_0.py


示例18: prepare

def prepare():
    meta = base.reflect_db_metadata()

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2015.1-8.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'roles': jsonutils.dumps([
                'controller',
                'compute',
                'virt',
                'compute-vmware',
                'ironic',
                'cinder',
                'cinder-block-device',
                'cinder-vmware',
                'ceph-osd',
                'mongo',
                'base-os',
            ]),
            'roles_metadata': jsonutils.dumps({
                'controller': {
                    'name': 'Controller',
                },
                'compute': {
                    'name': 'Compute',
                },
                'virt': {
                    'name': 'Virtual',
                },
                'compute-vmware': {
                    'name': 'Compute VMware',
                },
                'ironic': {
                    'name': 'Ironic',
                },
                'cinder': {
                    'name': 'Cinder',
                },
                'cinder-block-device': {
                    'name': 'Cinder Block Device',
                },
                'cinder-vmware': {
                    'name': 'Cinder Proxy to VMware Datastore',
                },
                'ceph-osd': {
                    'name': 'Ceph OSD',
                },
                'mongo': {
                    'name': 'Telemetry - MongoDB',
                },
                'base-os': {
                    'name': 'Operating System',
                }
            }),
            'networks_metadata': jsonutils.dumps({
                'neutron': {
                    'networks': [
                        {
                            'assign_vip': True,
                        },
                    ]
                },
                'nova_network': {
                    'networks': [
                        {
                            'assign_vip': False,
                        },
                    ]
                },

            }),
            'network_roles_metadata': jsonutils.dumps([{
                'id': 'admin/vip',
                'default_mapping': 'fuelweb_admin',
                'properties': {
                    'subnet': True,
                    'gateway': False,
                    'vip': [
                        {
                            'name': 'release-vip1',
                        },
                        {
                            'name': 'release-vip2',
                            'namespace': 'release-vip2-namespace'
                        }
                    ]
                }
            }]),
            'is_deployable': True,
        }])
    releaseid = result.inserted_primary_key[0]

    db.execute(
        meta.tables['clusters'].insert(),
        [{
            'name': 'test_env',
#.........这里部分代码省略.........
开发者ID:dnikishov,项目名称:fuel-web,代码行数:101,代码来源:test_migration_fuel_9_0.py


示例19: prepare

def prepare():
    meta = base.reflect_db_metadata()
    db.execute(
        meta.tables['plugins'].insert(),
        [{
            'name': 'test_plugin',
            'title': 'Test plugin',
            'version': '1.0.0',
            'description': 'Test plugin for Fuel',
            'homepage': 'http://fuel_plugins.test_plugin.com',
            'package_version': '3.0.0',
            'groups': jsonutils.dumps(['tgroup']),
            'authors': jsonutils.dumps(['tauthor']),
            'licenses': jsonutils.dumps(['tlicense']),
            'releases': jsonutils.dumps([
                {'repository_path': 'repositories/ubuntu'}
            ]),
            'fuel_version': jsonutils.dumps(['6.1', '7.0']),
        }])

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2014.2-6.1',
            'operating_system': 'ubuntu',
            'state': 'available',
            'roles': jsonutils.dumps([
                'controller',
                'compute',
                'mongo',
            ]),
            'roles_metadata': jsonutils.dumps({
                'controller': {
                    'name': 'Controller',
                    'description': 'Controller role',
                    'has_primary': True,
                },
                'zabbix-server': {
                    'name': 'Zabbix Server',
                    'description': 'Zabbix Server role'
                },
                'cinder': {
                    'name': 'Cinder',
                    'description': 'Cinder role'
                },
                'mongo': {
                    'name': 'Telemetry - MongoDB',
                    'description': 'mongo is',
                    'has_primary': True,
                }
            }),
            'attributes_metadata': jsonutils.dumps({}),
            'networks_metadata': jsonutils.dumps({
                'bonding': {
                    'properties': {
                        'linux': {
                            'mode': [
                                {
                                    "values": ["balance-rr",
                                               "active-backup",
                                               "802.3ad"]
                                },
                                {
                                    "values": ["balance-xor",
                                               "broadcast",
                                               "balance-tlb",
                                               "balance-alb"],
                                    "condition": "'experimental' in "
                                                 "version:feature_groups"
                                }
                            ]
                        }
                    }
                },
            }),
            'is_deployable': True,
        }])
    releaseid = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name_2',
            'version': '2014.2-6.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'roles': jsonutils.dumps([
                'controller',
                'compute',
                'mongo',
            ]),
            'roles_metadata': jsonutils.dumps({}),
            'attributes_metadata': jsonutils.dumps({}),
            'networks_metadata': jsonutils.dumps({
                'bonding': {
                    'properties': {
                        'ovs': {
                            'mode': [
                                {
#.........这里部分代码省略.........
开发者ID:prmtl,项目名称:fuel-web,代码行数:101,代码来源:test_migration_fuel_7_0.py


示例20: prepare

def prepare():
    meta = base.reflect_db_metadata()
    db.execute(
        meta.tables['plugins'].insert(),
        [{
            'name': 'test_plugin',
            'title': 'Test plugin',
            'version': '1.0.0',
            'description': 'Test plugin for Fuel',
            'homepage': 'http://fuel_plugins.test_plugin.com',
            'package_version': '3.0.0',
            'groups': jsonutils.dumps(['tgroup']),
            'authors': jsonutils.dumps(['tauthor']),
            'licenses': jsonutils.dumps(['tlicense']),
            'releases': jsonutils.dumps([
                {'repository_path': 'repositories/ubuntu'}
            ]),
            'fuel_version': jsonutils.dumps(['6.1', '7.0']),
        }])

    result = db.execute(
        meta.tables['releases'].insert(),
        [{
            'name': 'test_name',
            'version': '2014.2-6.0',
            'operating_system': 'ubuntu',
            'state': 'available',
            'roles': jsonutils.dumps([
                'controller',
                'compute',
                'mongo',
            ]),
            'roles_metadata': jsonutils.dumps({
                'controller': {
                    'name': 'Controller',
                    'description': 'Controller role',
                    'has_primary': True,
                },
                'zabbix-server': {
                    'name': 'Zabbix Server',
                    'description': 'Zabbix Server role'
                },
                'cinder': {
                    'name': 'Cinder',
                    'description': 'Cinder role'
                },
                'mongo': {
                    'name': 'Telemetry - MongoDB',
                    'description': 'mongo is',
                    'has_primary': True,
                }
            }),
            'attributes_metadata': jsonutils.dumps({}),
            'networks_metadata': jsonutils.dumps({}),
            'is_deployable': True,
        }])
    releaseid = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['nodes'].insert(),
        [
            {
                'uuid': 'one',
                'cluster_id': None,
                'group_id': None,
                'status': 'ready',
                'meta': '{}',
                'mac': 'aa:aa:aa:aa:aa:aa',
                'pending_addition': True,
                'pending_deletion': False,
                'timestamp': datetime.datetime.utcnow(),
            }
        ])
    nodeid_a = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['nodes'].insert(),
        [
            {
                'uuid': 'two',
                'cluster_id': None,
                'group_id': None,
                'status': 'discover',
                'meta': '{}',
                'mac': 'bb:bb:bb:bb:bb:bb',
                'pending_addition': True,
                'pending_deletion': False,
                'timestamp': datetime.datetime.utcnow(),
            }
        ])
    nodeid_b = result.inserted_primary_key[0]

    result = db.execute(
        meta.tables['nodes'].insert(),
        [
            {
                'uuid': 'three',
                'cluster_id': None,
                'group_id': None,
                'status': 'discover',
#.........这里部分代码省略.........
开发者ID:nebril,项目名称:fuel-web,代码行数:101,代码来源:test_migration_fuel_7_0.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python base.reverse函数代码示例发布时间:2022-05-27
下一篇:
Python task.TaskHelper类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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