本文整理汇总了Python中bkr.server.model.Job.cc方法的典型用法代码示例。如果您正苦于以下问题:Python Job.cc方法的具体用法?Python Job.cc怎么用?Python Job.cc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bkr.server.model.Job
的用法示例。
在下文中一共展示了Job.cc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_job_for_recipes
# 需要导入模块: from bkr.server.model import Job [as 别名]
# 或者: from bkr.server.model.Job import cc [as 别名]
def create_job_for_recipes(recipes, owner=None, whiteboard=None, cc=None,product=None,
retention_tag=None, group=None, submitter=None, priority=None, **kwargs):
if retention_tag is None:
retention_tag = RetentionTag.by_tag(u'scratch') # Don't use default, unpredictable
else:
retention_tag = RetentionTag.by_tag(retention_tag)
if owner is None:
owner = create_user()
if whiteboard is None:
whiteboard = unique_name(u'job %s')
job = Job(whiteboard=whiteboard, ttasks=sum(r.ttasks for r in recipes),
owner=owner, retention_tag=retention_tag, group=group, product=product,
submitter=submitter)
if cc is not None:
job.cc = cc
if priority is None:
priority = TaskPriority.default_priority()
recipe_set = RecipeSet(ttasks=sum(r.ttasks for r in recipes),
priority=priority)
recipe_set.recipes.extend(recipes)
job.recipesets.append(recipe_set)
session.add(job)
session.flush()
log.debug('Created %s', job.t_id)
return job