本文整理匯總了Python中bkr.server.model.RecipeTask.role方法的典型用法代碼示例。如果您正苦於以下問題:Python RecipeTask.role方法的具體用法?Python RecipeTask.role怎麽用?Python RecipeTask.role使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bkr.server.model.RecipeTask
的用法示例。
在下文中一共展示了RecipeTask.role方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_recipe
# 需要導入模塊: from bkr.server.model import RecipeTask [as 別名]
# 或者: from bkr.server.model.RecipeTask import role [as 別名]
def create_recipe(distro_tree=None, task_list=None,
task_name=u'/distribution/reservesys', whiteboard=None,
role=None, cls=MachineRecipe, **kwargs):
if not distro_tree:
distro_tree = create_distro_tree()
recipe = cls(ttasks=1)
recipe.whiteboard = whiteboard
recipe.distro_tree = distro_tree
recipe.role = role
recipe.distro_requires = recipe.distro_tree.to_xml().toxml()
if task_list: #don't specify a task_list and a task_name...
for t in task_list:
rt = RecipeTask(task=t)
rt.role = u'STANDALONE'
recipe.tasks.append(rt)
else:
rt = RecipeTask(task=create_task(name=task_name))
rt.role = u'STANDALONE'
recipe.tasks.append(rt)
return recipe