def handle_recipe_finished(sender, **kwargs): if sender: recipe = kwargs.get("recipe") b = Beaker() listurls = b.listLogs("R:%d" % int(recipe.uid)) for url in listurls: if len([it for it in backuplogs if url.endswith(it)]) > 0: b.downloadLog(url) logger.debug("Download recipe log %s from %s" % (recipe, sender))
def handle_recipe_finished(sender, **kwargs): if sender: recipe = kwargs.get("recipe") b = Beaker() listurls = b.listLogs("R:%d" % int(recipe.uid)) for url in listurls: if len([it for it in backuplogs if url.endswith(it)]) > 0: logpath = b.downloadLog(url) if not logpath: continue logfile = FileLog(path=logpath, recipe=recipe) logfile.save() logger.debug("Download recipe log %s from %s" % (recipe, sender))
def download_files_from_recipe(recipe): """ function download log files from beaker by global filter 'backuplogs' @param object(Recipe) download selected files from this recipe @return None """ b = Beaker() listurls = b.listLogs("R:%d" % int(recipe.uid)) for url in listurls: namefile = os.path.basename(urlparse(url).path) if namefile in backuplogs: logfile, created = FileLog.objects.get_or_create(url=url, recipe=recipe) if created: logfile.save()
def download_files_from_recipe(recipe): """ function download log files from beaker by global filter 'backuplogs' @param object(Recipe) download selected files from this recipe @return None """ b = Beaker() for url in b.listLogs(recipe.uid): namefile = os.path.basename(urlparse(url).path) if namefile in backuplogs: logfile, created = FileLog.objects.get_or_create( url=url, defaults={"recipe": recipe}) if created: logfile.save()