本文整理汇总了Python中job.Job.to_xml方法的典型用法代码示例。如果您正苦于以下问题:Python Job.to_xml方法的具体用法?Python Job.to_xml怎么用?Python Job.to_xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.Job
的用法示例。
在下文中一共展示了Job.to_xml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildsaenablejobs
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import to_xml [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