当前位置: 首页>>代码示例>>Python>>正文


Python InstallationInfo.get_clusters_info方法代码示例

本文整理汇总了Python中nailgun.statistics.fuel_statistics.installation_info.InstallationInfo.get_clusters_info方法的典型用法代码示例。如果您正苦于以下问题:Python InstallationInfo.get_clusters_info方法的具体用法?Python InstallationInfo.get_clusters_info怎么用?Python InstallationInfo.get_clusters_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nailgun.statistics.fuel_statistics.installation_info.InstallationInfo的用法示例。


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

示例1: test_network_configuration

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_clusters_info [as 别名]
    def test_network_configuration(self):
        info = InstallationInfo()
        # Checking nova network configuration
        nova = consts.CLUSTER_NET_PROVIDERS.nova_network
        self.env.create(cluster_kwargs={
            'mode': consts.CLUSTER_MODES.ha_full,
            'net_provider': nova
        })
        clusters_info = info.get_clusters_info()
        cluster_info = clusters_info[0]
        self.assertTrue('network_configuration' in cluster_info)
        network_config = cluster_info['network_configuration']

        for field in ('fixed_network_size', 'fixed_networks_vlan_start',
                      'fixed_networks_amount', 'net_manager'):
            self.assertIn(field, network_config)

        # Checking neutron network configuration
        neutron = consts.CLUSTER_NET_PROVIDERS.neutron
        self.env.create(cluster_kwargs={
            'mode': consts.CLUSTER_MODES.ha_full,
            'net_provider': neutron
        })
        clusters_info = info.get_clusters_info()
        # Clusters info is unordered list, so we should find required
        # cluster_info
        cluster_info = filter(lambda x: x['net_provider'] == neutron,
                              clusters_info)[0]
        self.assertTrue('network_configuration' in cluster_info)
        network_config = cluster_info['network_configuration']

        for field in ('segmentation_type', 'net_l23_provider'):
            self.assertIn(field, network_config)
开发者ID:apporc,项目名称:fuel-web,代码行数:35,代码来源:test_installation_info.py

示例2: test_network_configuration

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_clusters_info [as 别名]
    def test_network_configuration(self):
        info = InstallationInfo()
        # Checking nova network configuration
        nova = consts.CLUSTER_NET_PROVIDERS.nova_network
        self.env.create(cluster_kwargs={"mode": consts.CLUSTER_MODES.ha_compact, "net_provider": nova})
        clusters_info = info.get_clusters_info()
        cluster_info = clusters_info[0]
        self.assertTrue("network_configuration" in cluster_info)
        network_config = cluster_info["network_configuration"]

        for field in ("fixed_network_size", "fixed_networks_vlan_start", "fixed_networks_amount", "net_manager"):
            self.assertIn(field, network_config)

        # Checking neutron network configuration
        neutron = consts.CLUSTER_NET_PROVIDERS.neutron
        self.env.create(cluster_kwargs={"mode": consts.CLUSTER_MODES.ha_compact, "net_provider": neutron})
        clusters_info = info.get_clusters_info()
        # Clusters info is unordered list, so we should find required
        # cluster_info
        cluster_info = filter(lambda x: x["net_provider"] == neutron, clusters_info)[0]
        self.assertTrue("network_configuration" in cluster_info)
        network_config = cluster_info["network_configuration"]

        for field in ("segmentation_type", "net_l23_provider"):
            self.assertIn(field, network_config)
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:27,代码来源:test_installation_info.py

示例3: test_clusters_info

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_clusters_info [as 别名]
    def test_clusters_info(self):
        self.env.upload_fixtures(['openstack'])
        info = InstallationInfo()
        release = ReleaseCollection.filter_by(
            None, operating_system=consts.RELEASE_OS.ubuntu)
        nodes_params = [
            {'roles': ['compute']},
            {'roles': ['compute']},
            {'roles': ['controller']}
        ]
        cluster = self.env.create(
            cluster_kwargs={
                'release_id': release[0].id,
                'mode': consts.CLUSTER_MODES.ha_compact,
                'net_provider': consts.CLUSTER_NET_PROVIDERS.neutron},
            nodes_kwargs=nodes_params
        )
        self.env.create_node(
            {'status': consts.NODE_STATUSES.discover})
        clusters_info = info.get_clusters_info()
        self.assertEquals(1, len(clusters_info))
        cluster_info = clusters_info[0]

        self.assertEquals(len(nodes_params), len(cluster_info['nodes']))
        self.assertEquals(len(nodes_params), cluster_info['nodes_num'])

        self.assertEquals(consts.CLUSTER_MODES.ha_compact,
                          cluster_info['mode'])
        self.assertEquals(consts.CLUSTER_NET_PROVIDERS.neutron,
                          cluster_info['net_provider'])
        self.assertEquals(consts.CLUSTER_STATUSES.new,
                          cluster_info['status'])
        self.assertEquals(False,
                          cluster_info['is_customized'])

        self.assertEquals(cluster['id'],
                          cluster_info['id'])
        self.assertEquals(cluster.fuel_version,
                          cluster_info['fuel_version'])

        self.assertTrue('attributes' in cluster_info)

        self.assertTrue('release' in cluster_info)
        self.assertEquals(cluster.release.operating_system,
                          cluster_info['release']['os'])
        self.assertEquals(cluster.release.name,
                          cluster_info['release']['name'])
        self.assertEquals(cluster.release.version,
                          cluster_info['release']['version'])

        self.assertEquals(1, len(cluster_info['node_groups']))
        group_info = cluster_info['node_groups'][0]
        group = [ng for ng in cluster.node_groups][0]
        self.assertEquals(group.id,
                          group_info['id'])
        self.assertEquals(len(nodes_params),
                          len(group_info['nodes']))
        self.assertEquals(set([n.id for n in group.nodes]),
                          set(group_info['nodes']))
开发者ID:mmalchuk,项目名称:openstack-fuel-web,代码行数:61,代码来源:test_installation_info.py

示例4: test_clusters_info

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_clusters_info [as 别名]
    def test_clusters_info(self):
        self.env.upload_fixtures(["openstack"])
        info = InstallationInfo()
        release = ReleaseCollection.filter_by(None, operating_system=consts.RELEASE_OS.ubuntu)
        nodes_params = [{"roles": ["compute"]}, {"roles": ["compute"]}, {"roles": ["controller"]}]
        self.env.create(
            cluster_kwargs={
                "release_id": release[0].id,
                "mode": consts.CLUSTER_MODES.ha_compact,
                "net_provider": consts.CLUSTER_NET_PROVIDERS.nova_network,
            },
            nodes_kwargs=nodes_params,
        )
        self.env.create_node({"status": consts.NODE_STATUSES.discover})
        clusters_info = info.get_clusters_info()
        cluster = self.env.clusters[0]
        self.assertEquals(1, len(clusters_info))
        cluster_info = clusters_info[0]

        self.assertEquals(len(nodes_params), len(cluster_info["nodes"]))
        self.assertEquals(len(nodes_params), cluster_info["nodes_num"])

        self.assertEquals(consts.CLUSTER_MODES.ha_compact, cluster_info["mode"])
        self.assertEquals(consts.CLUSTER_NET_PROVIDERS.nova_network, cluster_info["net_provider"])
        self.assertEquals(consts.CLUSTER_STATUSES.new, cluster_info["status"])
        self.assertEquals(False, cluster_info["is_customized"])

        self.assertEquals(cluster.id, cluster_info["id"])
        self.assertEquals(cluster.fuel_version, cluster_info["fuel_version"])

        self.assertTrue("attributes" in cluster_info)

        self.assertTrue("release" in cluster_info)
        self.assertEquals(cluster.release.operating_system, cluster_info["release"]["os"])
        self.assertEquals(cluster.release.name, cluster_info["release"]["name"])
        self.assertEquals(cluster.release.version, cluster_info["release"]["version"])

        self.assertEquals(1, len(cluster_info["node_groups"]))
        group_info = cluster_info["node_groups"][0]
        group = [ng for ng in cluster.node_groups][0]
        self.assertEquals(group.id, group_info["id"])
        self.assertEquals(len(nodes_params), len(group_info["nodes"]))
        self.assertEquals(set([n.id for n in group.nodes]), set(group_info["nodes"]))
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:45,代码来源:test_installation_info.py


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