fix: recursive search for manifest.json after tar extraction (files may be nested)

This commit is contained in:
2026-05-23 00:20:36 +04:00
parent c8bef6b41a
commit 79b91f157e

View File

@@ -165,9 +165,13 @@ def do_restore():
manifest_file = None manifest_file = None
if os.path.isdir(remote_dir): if os.path.isdir(remote_dir):
for f in os.listdir(remote_dir): # Рекурсивный поиск manifest.json (может быть в подпапках после tar xzf)
if f.endswith("_manifest.json"): for root, _, files in os.walk(remote_dir):
manifest_file = os.path.join(remote_dir, f) for f in files:
if f.endswith("_manifest.json"):
manifest_file = os.path.join(root, f)
break
if manifest_file:
break break
if not manifest_file: if not manifest_file:
raise RuntimeError("manifest.json не найден в папке архива") raise RuntimeError("manifest.json не найден в папке архива")