From 7d0119ade48e9627be25e5857f9d0ff91bd65747 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 15 Oct 2019 01:06:04 +0200 Subject: [PATCH] Fix backup info.json format... --- src/yunohost/backup.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index c28160342..4bf8d8afc 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -602,10 +602,10 @@ class BackupManager(): env=env_dict, chdir=self.work_dir) - ret_succeed = {hook: {path:result["state"] for path, result in infos.items()} + ret_succeed = {hook: [path for path, result in infos.items() if result["state"] == "succeed"] for hook, infos in ret.items() if any(result["state"] == "succeed" for result in infos.values())} - ret_failed = {hook: {path:result["state"] for path, result in infos.items.items()} + ret_failed = {hook: [path for path, result in infos.items.items() if result["state"] == "failed"] for hook, infos in ret.items() if any(result["state"] == "failed" for result in infos.values())} @@ -2371,6 +2371,13 @@ def backup_info(name, with_details=False, human_readable=False): if "size_details" in info.keys(): for category in ["apps", "system"]: for name, key_info in info[category].items(): + + # Stupid legacy fix for weird format between 3.5 and 3.6 + if isinstance(key_info, dict): + key_info = key_info.keys() + + info[category][name] = key_info = {"paths": key_info} + if name in info["size_details"][category].keys(): key_info["size"] = info["size_details"][category][name] if human_readable: