def register_file(self, server, task_id, path, filename, basepath): """ register file and return path to store """ try: recipetask = RecipeTask.by_id(task_id) except InvalidRequestError: raise BX(_('Invalid task ID: %s' % task_id)) if recipetask.is_finished(): raise BX('Cannot register file for finished task %s' % recipetask.t_id) # Add the log to the DB if it hasn't been recorded yet. log_recipe = LogRecipeTask.lazy_create(recipe_task_id=recipetask.id, path=path, filename=filename, ) log_recipe.server = server log_recipe.basepath = basepath recipetask.recipe.log_server = urlparse.urlparse(server)[1] return '%s' % recipetask.filepath
def register_file(self, server, task_id, path, filename, basepath): """ register file and return path to store """ try: recipetask = RecipeTask.by_id(task_id) except InvalidRequestError: raise BX(_('Invalid task ID: %s' % task_id)) if recipetask.is_finished(): raise BX('Cannot register file for finished task %s' % recipetask.t_id) # Add the log to the DB if it hasn't been recorded yet. log_recipe = LogRecipeTask.lazy_create( recipe_task_id=recipetask.id, path=path, filename=filename, ) log_recipe.server = server log_recipe.basepath = basepath recipetask.recipe.log_server = urlparse.urlparse(server)[1] return '%s' % recipetask.filepath
def register_file(self, server, task_id, path, filename, basepath): """ register file and return path to store """ try: recipetask = RecipeTask.by_id(task_id, lockmode='update') except NoResultFound: raise BX(_('Invalid task ID: %s' % task_id)) Recipe.by_id(recipetask.recipe_id, lockmode='update') if recipetask.is_finished(): raise BX('Cannot register file for finished task %s' % recipetask.t_id) self._check_log_limit(recipetask) # Add the log to the DB if it hasn't been recorded yet. log_recipe = LogRecipeTask.lazy_create(recipe_task_id=recipetask.id, path=path, filename=filename, ) log_recipe.server = server log_recipe.basepath = basepath recipetask.recipe.log_server = urlparse.urlparse(server)[1] return '%s' % recipetask.filepath
def register_file(self, server, task_id, path, filename, basepath): """ register file and return path to store """ try: recipetask = RecipeTask.by_id(task_id, lockmode='update') except NoResultFound: raise BX(_('Invalid task ID: %s' % task_id)) Recipe.by_id(recipetask.recipe_id, lockmode='update') if recipetask.is_finished(): raise BX('Cannot register file for finished task %s' % recipetask.t_id) self._check_log_limit(recipetask) # Add the log to the DB if it hasn't been recorded yet. log_recipe = LogRecipeTask.lazy_create( recipe_task_id=recipetask.id, path=path, filename=filename, ) log_recipe.server = server log_recipe.basepath = basepath recipetask.recipe.log_server = urlparse.urlparse(server)[1] return '%s' % recipetask.filepath