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


Python Job.setName方法代码示例

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


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

示例1: buildsaenablejobs

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setName [as 别名]
    def buildsaenablejobs(cls,tenant):
        context = cls._buildcontext(tenant)
        svclist = tenant.services
        jobs = []

        for svc in svclist:
            if svc.name == "vpc":
                continue
            nodes = svc.nodes
            for node in nodes:
                job = Job()
                job.node = node
                job.nodeId = node.stackid
                job.setGroup(tenant.id)
                job.setName("[%s]%s:(%s)" % (node.vmtype,node.manageip,"SA_Provision"))
                job.setNodeFilter(node.manageip)
                WF= factory.ServiceFactory.createfactory(svc.name).createWFBuilder("SA_Provision").buildWF(context)
                if len(WF) == 0:
                    logger.info("no need to run job(%s), becasue no work flow" % "[%s]%s:(%s)" % (node.vmtype,node.manageip,"SA_Provision"))
                    continue
                for step in WF:
                    step.attach(job)
                print job.to_xml()
                jobs.append(job)
        return jobs
开发者ID:codebang,项目名称:dms-sa,代码行数:27,代码来源:jobbuilder.py

示例2: buildsaenablejobs

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setName [as 别名]
 def buildsaenablejobs(cls,service):
     nodes = service.nodes
     context = cls._buildcontext(nodes)
     jobs = []
     for node in nodes:
         job = Job()
         job.setName(cls._buildjobname(node,"PACKAGE_ACTIVATE"))
         job.setNodeFilter(node.manageip)
         WF= factory.NodeFactory.createfactory(node.vmtype).createWFBuilder("PACKAGE_ACTIVATE",context).buildWF()
         for step in WF:
             step.join(job)
         jobs.append(job)
     return jobs
开发者ID:codebang,项目名称:dms,代码行数:15,代码来源:jobbuilder.py

示例3: JobTestCase

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setName [as 别名]
class JobTestCase(unittest.TestCase):
    
    def setUp(self):
        self.job = Job()

    def testName(self):
        """Set job name"""
        correct = "test"
        self.job.setName(correct)
        self.assertEqual(self.job.name, correct, "Value= '{0}', Expected= '{1}'".format(self.job.name, correct))

    def testParallel(self):
        """Set parallel job"""
        self.job.setIsParallel(True)
        assert self.job.isParallel, "Job is not parallel and should be."
开发者ID:ebreitmo,项目名称:bolt,代码行数:17,代码来源:testJob.py

示例4: buildmonitorcpejob

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setName [as 别名]
    def buildmonitorcpejob(cls,tenant):
        ctx = ServiceContext()
        config = ctx.getConfigService()
        host = config.get("monitorcpe","host")
        cmd = config.get("monitorcpe","command")
        lockcmd = config.get("monitorcpe","getlock")
        releasecmd = config.get("monitorcpe","releaselock")
        svclist = tenant.services
        for svc in svclist:
            if svc.name == "vrouter":
                nodes = svc.nodes
                for node in nodes:
                    job = Job()
                    job.node = node
                    job.setNodeFilter(host)
                    job.setGroup(tenant.id)
                    job.setName("MonitorCPETest")
                    job.addlocalcommand(lockcmd)
                    job.addcommand(cmd + " -c 6620e868-e9df-4c8d-8c74-87fe364f7222 -l 10.74.113.116 -r 10.74.113.117 -x 204 -y 205")
                    job.addcommand(releasecmd)
                    return job


        return None
开发者ID:codebang,项目名称:dms-sa,代码行数:26,代码来源:jobbuilder.py


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