From 3ec476ea63f9330f73e583feac1a06b8866c9e40 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 03 2019 06:25:52 +0000 Subject: Fix getting list of containers from old metadata Old versions of Pungi (and all versions of Distill) include NVR for containers only as separate components, not as the single field. This leads to a KeyError. Signed-off-by: Lubomír Sedlář --- diff --git a/compose_utils/essentials.py b/compose_utils/essentials.py index d79e20d..9c63b0a 100644 --- a/compose_utils/essentials.py +++ b/compose_utils/essentials.py @@ -41,7 +41,7 @@ def get_containers(compose): for container in metadata[variant][arch]: containers[ ( - container["nvr"], + "%(name)s-%(version)s-%(release)s" % container, container["docker"]["config"]["config"]["Labels"]["name"], ) ].append(container["docker"]["repositories"][0]) diff --git a/tests/composes/DP-1.0-20181012.t.0/compose/metadata/osbs.json b/tests/composes/DP-1.0-20181012.t.0/compose/metadata/osbs.json index 35fa72f..16fad33 100644 --- a/tests/composes/DP-1.0-20181012.t.0/compose/metadata/osbs.json +++ b/tests/composes/DP-1.0-20181012.t.0/compose/metadata/osbs.json @@ -3,6 +3,9 @@ "aarch64": [ { "nvr": "dp-1.0-1", + "name": "dp", + "version": "1.0", + "release": "1", "docker": { "config": { "config": { @@ -21,6 +24,9 @@ "x86_64": [ { "nvr": "dp-1.0-1", + "name": "dp", + "version": "1.0", + "release": "1", "docker": { "config": { "config": {