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


Python Job.setNodeFilter方法代码示例

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


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

示例1: buildsaenablejobs

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setNodeFilter [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 setNodeFilter [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: buildmonitorcpejob

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import setNodeFilter [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.setNodeFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。