Fix backup info.json format...

This commit is contained in:
Alexandre Aubin 2019-10-15 01:06:04 +02:00
parent 61931f2c4b
commit 7d0119ade4

View file

@ -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: