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


Python TaskHelper.prepare_for_deployment方法代码示例

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


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

示例1: create_env

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def create_env(self, nodes):
        cluster = self.env.create(
            nodes_kwargs=nodes)

        cluster_db = self.db.query(Cluster).get(cluster['id'])
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        return cluster_db
开发者ID:Mellanox,项目名称:fuel-web,代码行数:9,代码来源:test_task_helpers.py

示例2: _create_cluster_for_vlan_splinters

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def _create_cluster_for_vlan_splinters(self, segment_type='gre'):
        meta = {
            'interfaces': [
                {'name': 'eth0', 'mac': self.env._generate_random_mac()},
                {'name': 'eth1', 'mac': self.env._generate_random_mac()},
                {'name': 'eth2', 'mac': self.env._generate_random_mac()},
                {'name': 'eth3', 'mac': self.env._generate_random_mac()},
                {'name': 'eth4', 'mac': self.env._generate_random_mac()}
            ]
        }
        cluster = self.env.create(
            cluster_kwargs={
                'mode': 'multinode',
                'net_provider': 'neutron',
                'net_segment_type': segment_type
            },
            nodes_kwargs=[
                {'roles': ['controller'], 'pending_addition': True,
                 'meta': meta}
            ]
        )

        cluster_db = self.db.query(Cluster).get(cluster['id'])
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        return cluster_db
开发者ID:kdemina,项目名称:fuel-web,代码行数:27,代码来源:test_orchestrator_serializer.py

示例3: test_do_not_redeploy_nodes_in_ready_status

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def test_do_not_redeploy_nodes_in_ready_status(self):
        self.env.create(nodes_kwargs=[
            {"pending_addition": True},
            {"pending_addition": True, 'roles': ['compute']}])
        cluster_db = self.env.clusters[0]
        # Generate ips, fqdns
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        # First node with status ready
        # should not be readeployed
        self.env.nodes[0].status = 'ready'
        self.env.nodes[0].pending_addition = False
        self.db.commit()

        cluster_db.clear_pending_changes()

        supertask = self.env.launch_deployment()
        self.assertEquals(supertask.name, 'deploy')
        self.assertIn(supertask.status, ('running', 'ready'))

        self.assertEquals(self.env.nodes[0].status, 'ready')
        self.env.wait_for_nodes_status([self.env.nodes[1]], 'provisioning')
        self.env.wait_ready(supertask)

        self.env.refresh_nodes()

        self.assertEquals(self.env.nodes[1].status, 'ready')
        self.assertEquals(self.env.nodes[1].progress, 100)
开发者ID:stamak,项目名称:fuel-web,代码行数:29,代码来源:test_task_managers.py

示例4: test_repo_and_puppet_data

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def test_repo_and_puppet_data(self):
        release_id = self.env.create_release().id

        orch_data = {
            "repo_metadata": {
                "nailgun":
                "http://10.20.0.2:8080/centos-5.0/centos/fuelweb/x86_64/"
            },
            "puppet_modules_source":
            "rsync://10.20.0.2/puppet/release/5.0/modules",
            "puppet_manifests_source":
            "rsync://10.20.0.2/puppet/release/5.0/manifests"
        }
        resp = self.app.put(
            reverse('ReleaseHandler', kwargs={'obj_id': release_id}),
            params=json.dumps(
                {
                    "orchestrator_data": orch_data
                }
            ),
            headers=self.default_headers,
            expect_errors=True
        )
        self.assertEquals(200, resp.status_code)

        cluster_id = self.env.create(
            cluster_kwargs={
                'release_id': release_id
            },
            nodes_kwargs=[
                {'roles': ['controller'], 'pending_addition': True}
            ]
        )["id"]

        cluster = self.db.query(Cluster).get(cluster_id)
        TaskHelper.prepare_for_deployment(cluster.nodes)
        facts = self.serializer.serialize(cluster, cluster.nodes)

        self.assertEquals(1, len(facts))
        fact = facts[0]
        self.assertEquals(
            fact['repo_metadata'],
            {
                'nailgun': 'http://10.20.0.2:8080'
                           '/centos-5.0/centos/fuelweb/x86_64/'
            }
        )
        self.assertEquals(
            fact['puppet_modules_source'],
            'rsync://10.20.0.2/puppet/release/5.0/modules'
        )
        self.assertEquals(
            fact['puppet_manifests_source'],
            'rsync://10.20.0.2/puppet/release/5.0/manifests'
        )
开发者ID:Mellanox,项目名称:fuel-web,代码行数:57,代码来源:test_orchestrator_serializer.py

示例5: serialize

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
def serialize(cluster, nodes):
    """Serialization depends on deployment mode
    """
    TaskHelper.prepare_for_deployment(cluster.nodes)

    if cluster.mode == 'multinode':
        serializer = DeploymentMultinodeSerializer
    elif cluster.is_ha_mode:
        serializer = DeploymentHASerializer

    return serializer.serialize(cluster, nodes)
开发者ID:sk4lf,项目名称:fuel-web,代码行数:13,代码来源:deployment_serializers.py

示例6: create_env

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def create_env(self, mode, network_manager="FlatDHCPManager"):
        node_args = [
            {"roles": ["controller", "cinder"], "pending_addition": True},
            {"roles": ["compute", "cinder"], "pending_addition": True},
            {"roles": ["compute"], "pending_addition": True},
            {"roles": [], "pending_roles": ["cinder"], "pending_addition": True},
        ]
        cluster = self.env.create(cluster_kwargs={"mode": mode, "net_manager": network_manager}, nodes_kwargs=node_args)

        cluster_db = self.db.query(Cluster).get(cluster["id"])
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        return cluster_db
开发者ID:ustbgaofan,项目名称:fuel-web,代码行数:14,代码来源:test_orchestrator_serializer.py

示例7: test_serialize_node

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def test_serialize_node(self):
        node = self.env.create_node(api=True, cluster_id=self.cluster.id, pending_addition=True)
        TaskHelper.prepare_for_deployment(self.cluster.nodes)

        node_db = self.db.query(Node).get(node["id"])
        serialized_data = self.serializer.serialize_node(node_db, "controller")

        self.assertEquals(serialized_data["role"], "controller")
        self.assertEquals(serialized_data["uid"], str(node_db.id))
        self.assertEquals(serialized_data["status"], node_db.status)
        self.assertEquals(serialized_data["online"], node_db.online)
        self.assertEquals(serialized_data["fqdn"], "node-%d.%s" % (node_db.id, settings.DNS_DOMAIN))
开发者ID:ustbgaofan,项目名称:fuel-web,代码行数:14,代码来源:test_orchestrator_serializer.py

示例8: test_serialize_node

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def test_serialize_node(self):
        node = self.env.create_node(
            api=True, cluster_id=self.cluster.id, pending_addition=True)
        TaskHelper.prepare_for_deployment(self.cluster.nodes)

        node_db = self.db.query(Node).get(node['id'])
        serialized_data = self.serializer.serialize_node(node_db, 'controller')

        self.assertEquals(serialized_data['role'], 'controller')
        self.assertEquals(serialized_data['uid'], str(node_db.id))
        self.assertEquals(serialized_data['status'], node_db.status)
        self.assertEquals(serialized_data['online'], node_db.online)
        self.assertEquals(serialized_data['fqdn'],
                          'node-%d.%s' % (node_db.id, settings.DNS_DOMAIN))
开发者ID:kdemina,项目名称:fuel-web,代码行数:16,代码来源:test_orchestrator_serializer.py

示例9: create_env

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
 def create_env(self):
     cluster = self.env.create(
         cluster_kwargs={
             'mode': 'ha_compact',
             'network_manager': 'FlatDHCPManager'
         },
         nodes_kwargs=[
             {'roles': ['mongo'], 'pending_addition': True},
             {'roles': ['mongo'], 'pending_addition': True},
             {'roles': ['mongo'], 'pending_addition': True}
         ]
     )
     cluster = self.db.query(Cluster).get(cluster['id'])
     TaskHelper.prepare_for_deployment(cluster.nodes)
     return cluster
开发者ID:Mellanox,项目名称:fuel-web,代码行数:17,代码来源:test_orchestrator_serializer.py

示例10: create_env

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def create_env(self, mode, network_manager='FlatDHCPManager'):
        node_args = [
            {'roles': ['controller', 'cinder'], 'pending_addition': True},
            {'roles': ['compute', 'cinder'], 'pending_addition': True},
            {'roles': ['compute'], 'pending_addition': True},
            {'roles': [], 'pending_roles': ['cinder'],
             'pending_addition': True}]
        cluster = self.env.create(
            cluster_kwargs={
                'mode': mode,
                'net_manager': network_manager},
            nodes_kwargs=node_args)

        cluster_db = self.db.query(Cluster).get(cluster['id'])
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        return cluster_db
开发者ID:kdemina,项目名称:fuel-web,代码行数:18,代码来源:test_orchestrator_serializer.py

示例11: _create_cluster_for_vlan_splinters

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
    def _create_cluster_for_vlan_splinters(self, segment_type="gre"):
        meta = {
            "interfaces": [
                {"name": "eth0", "mac": self.env._generate_random_mac()},
                {"name": "eth1", "mac": self.env._generate_random_mac()},
                {"name": "eth2", "mac": self.env._generate_random_mac()},
                {"name": "eth3", "mac": self.env._generate_random_mac()},
                {"name": "eth4", "mac": self.env._generate_random_mac()},
            ]
        }
        cluster = self.env.create(
            cluster_kwargs={"mode": "multinode", "net_provider": "neutron", "net_segment_type": segment_type},
            nodes_kwargs=[{"roles": ["controller"], "pending_addition": True, "meta": meta}],
        )

        cluster_db = self.db.query(Cluster).get(cluster["id"])
        TaskHelper.prepare_for_deployment(cluster_db.nodes)
        return cluster_db
开发者ID:ustbgaofan,项目名称:fuel-web,代码行数:20,代码来源:test_orchestrator_serializer.py

示例12: serialize

# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import prepare_for_deployment [as 别名]
 def serialize(self, cluster):
     TaskHelper.prepare_for_deployment(cluster.nodes)
     return DeploymentMultinodeSerializer.serialize(cluster, cluster.nodes)
开发者ID:stamak,项目名称:fuel-web,代码行数:5,代码来源:test_orchestrator_serializer.py


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