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


Python Task.name方法代码示例

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


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

示例1: execute

# 需要导入模块: from nailgun.api.models import Task [as 别名]
# 或者: from nailgun.api.models.Task import name [as 别名]
 def execute(self, nets, vlan_ids):
     task = Task(
         name="check_networks",
         cluster=self.cluster
     )
     orm().add(task)
     orm().commit()
     self._call_silently(
         task,
         tasks.CheckNetworksTask,
         nets
     )
     orm().refresh(task)
     if task.status != 'error':
         # this one is connected with UI issues - we need to
         # separate if error happened inside nailgun or somewhere
         # in the orchestrator, and UI does it by task name.
         task.name = "verify_networks"
         orm().add(task)
         orm().commit()
         self._call_silently(
             task,
             tasks.VerifyNetworksTask,
             vlan_ids
         )
     return task
开发者ID:akolinko,项目名称:product,代码行数:28,代码来源:manager.py

示例2: execute

# 需要导入模块: from nailgun.api.models import Task [as 别名]
# 或者: from nailgun.api.models.Task import name [as 别名]
    def execute(self, nets, vlan_ids):
        self.remove_previous_task()

        task = Task(
            name="check_networks",
            cluster=self.cluster
        )
        if not task.cluster.nodes:
            task.status = 'error'
            task.message = ('There should be at least 1 node for dhcp check.'
                            'And 2 nodes for connectivity check')

        db().add(task)
        db().commit()

        self._call_silently(
            task,
            tasks.CheckNetworksTask,
            data=nets,
            check_admin_untagged=True
        )
        db().refresh(task)

        #disable neutron with vlan connectivity check after deployment
        if task.status != 'error':
            if (
                task.cluster.status != 'new' and
                task.cluster.net_provider == 'neutron'
            ):
                task.status = 'error'
                task.message = ('Network verification on Neutron'
                                ' is not implemented yet')

                db().commit()

        if task.status != 'error':
            # this one is connected with UI issues - we need to
            # separate if error happened inside nailgun or somewhere
            # in the orchestrator, and UI does it by task name.

            dhcp_subtask = Task(
                name='check_dhcp',
                cluster=self.cluster,
                parent_id=task.id)
            db().add(dhcp_subtask)
            db().commit()
            db().refresh(task)

            task.name = 'verify_networks'

            self._call_silently(
                task,
                tasks.VerifyNetworksTask,
                vlan_ids
            )

        return task
开发者ID:adanin,项目名称:fuel-web,代码行数:59,代码来源:manager.py

示例3: execute

# 需要导入模块: from nailgun.api.models import Task [as 别名]
# 或者: from nailgun.api.models.Task import name [as 别名]
    def execute(self, nets, vlan_ids):
        self.remove_previous_task()

        task = Task(
            name="check_networks",
            cluster=self.cluster
        )
        if not task.cluster.nodes:
            task.status = 'error'
            task.message = ('There should be at least 1 node for dhcp check.'
                            'And 2 nodes for connectivity check')

        db().add(task)
        db().commit()

        self._call_silently(
            task,
            tasks.CheckNetworksTask,
            nets
        )
        db().refresh(task)

        if task.status != 'error':
            # this one is connected with UI issues - we need to
            # separate if error happened inside nailgun or somewhere
            # in the orchestrator, and UI does it by task name.

            dhcp_subtask = Task(
                name='check_dhcp',
                cluster=self.cluster,
                parent_id=task.id)
            db().add(dhcp_subtask)
            db().commit()
            db().refresh(task)

            task.name = 'verify_networks'

            self._call_silently(
                task,
                tasks.VerifyNetworksTask,
                vlan_ids
            )

        return task
开发者ID:andrey-borisov,项目名称:fuel-web,代码行数:46,代码来源:manager.py


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