From 20477530965e68b87602bef3fc4c96605ae4a48c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 13 Apr 2020 21:26:56 +0200 Subject: [PATCH] Ensure that app installs layers in correct order --- usr/lib/python3.8/vmmgr/vmmgr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/lib/python3.8/vmmgr/vmmgr.py b/usr/lib/python3.8/vmmgr/vmmgr.py index f79045f..0441b4f 100644 --- a/usr/lib/python3.8/vmmgr/vmmgr.py +++ b/usr/lib/python3.8/vmmgr/vmmgr.py @@ -200,7 +200,8 @@ def install_app(app_name, queue): for container in new_containers: required_images.extend(repo_online.get_image(container['image'])['layers']) local_images = repo_local.get_images() - for layer in set(required_images): + # Layers need to be downloaded in correct order + for layer in list(dict.fromkeys(required_images)): if layer not in local_images: queue.download_image(Image(layer, False)) queue.install_app(App(app_name, False, False)) @@ -221,7 +222,8 @@ def update_app(app_name, queue): for container in new_containers: required_images.extend(repo_online.get_image(container['image'])['layers']) local_images = repo_local.get_images() - for layer in set(required_images): + # Layers need to be downloaded in correct order + for layer in list(dict.fromkeys(required_images)): if layer not in local_images: queue.download_image(Image(layer, False)) app = App(app_name, False)