本文整理汇总了Python中bkr.server.model.RecipeTask.from_fetch_url方法的典型用法代码示例。如果您正苦于以下问题:Python RecipeTask.from_fetch_url方法的具体用法?Python RecipeTask.from_fetch_url怎么用?Python RecipeTask.from_fetch_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bkr.server.model.RecipeTask
的用法示例。
在下文中一共展示了RecipeTask.from_fetch_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from bkr.server.model import RecipeTask [as 别名]
# 或者: from bkr.server.model.RecipeTask import from_fetch_url [as 别名]
def setUp(self):
with session.begin():
self.recipe = data_setup.create_recipe(task_name=u'/distribution/install')
self.recipe.tasks.extend([
RecipeTask.from_task(data_setup.create_task()),
RecipeTask.from_fetch_url(u'http://example.com/tasks/example.tar.bz2'),
])
data_setup.create_job_for_recipes([self.recipe])
data_setup.mark_recipe_running(self.recipe)
示例2: hasattr
# 需要导入模块: from bkr.server.model import RecipeTask [as 别名]
# 或者: from bkr.server.model.RecipeTask import from_fetch_url [as 别名]
recipe.ks_appends.append(RecipeKSAppend(ks_append=xmlksappend))
xmltasks = []
invalid_tasks = []
for xmltask in xmlrecipe.iter_tasks():
if hasattr(xmltask, 'fetch'):
# If fetch URL is given, the task doesn't need to exist.
xmltasks.append(xmltask)
elif Task.exists_by_name(xmltask.name, valid=True):
xmltasks.append(xmltask)
else:
invalid_tasks.append(xmltask.name)
if invalid_tasks and not ignore_missing_tasks:
raise BX(_('Invalid task(s): %s') % ', '.join(invalid_tasks))
for xmltask in xmltasks:
if hasattr(xmltask, 'fetch'):
recipetask = RecipeTask.from_fetch_url(xmltask.fetch.url,
subdir=xmltask.fetch.subdir, name=xmltask.name)
else:
recipetask = RecipeTask.from_task(Task.by_name(xmltask.name))
recipetask.role = xmltask.role
for xmlparam in xmltask.iter_params():
param = RecipeTaskParam( name=xmlparam.name,
value=xmlparam.value)
recipetask.params.append(param)
recipe.tasks.append(recipetask)
if not recipe.tasks:
raise BX(_('No Tasks! You can not have a recipe with no tasks!'))
return recipe
@expose('json')
def update_recipe_set_response(self,recipe_set_id,response_id):
rs = RecipeSet.by_id(recipe_set_id)