本文整理汇总了Python中bkr.server.model.Job.retention_tag方法的典型用法代码示例。如果您正苦于以下问题:Python Job.retention_tag方法的具体用法?Python Job.retention_tag怎么用?Python Job.retention_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bkr.server.model.Job
的用法示例。
在下文中一共展示了Job.retention_tag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ValueError
# 需要导入模块: from bkr.server.model import Job [as 别名]
# 或者: from bkr.server.model.Job import retention_tag [as 别名]
group_name = xmljob.get_xml_attr('group', unicode, None)
group = None
if group_name:
try:
group = Group.by_name(group_name)
except NoResultFound, e:
raise ValueError('%s is not a valid group' % group_name)
if group not in owner.groups:
raise BX(_(u'User %s is not a member of group %s' % (owner.user_name, group.group_name)))
job_retention = xmljob.get_xml_attr('retention_tag',unicode,None)
job_product = xmljob.get_xml_attr('product',unicode,None)
tag, product = self._process_job_tag_product(retention_tag=job_retention, product=job_product)
job = Job(whiteboard=unicode(xmljob.whiteboard), ttasks=0, owner=owner,
group=group, submitter=submitter)
job.product = product
job.retention_tag = tag
email_validator = validators.Email(not_empty=True)
for addr in set(xmljob.iter_cc()):
try:
job.cc.append(email_validator.to_python(addr))
except Invalid, e:
raise BX(_('Invalid e-mail address %r in <cc/>: %s') % (addr, str(e)))
for xmlrecipeSet in xmljob.iter_recipeSets():
recipe_set = self._handle_recipe_set(xmlrecipeSet, owner,
ignore_missing_tasks=ignore_missing_tasks)
job.recipesets.append(recipe_set)
job.ttasks += recipe_set.ttasks
if not job.recipesets:
raise BX(_('No RecipeSets! You can not have a Job with no recipeSets!'))
session.add(job)