From ca3941feb67202f7165c7dde0ff12fae5601f0cf Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 23 Aug 2021 21:51:00 +0000 Subject: [PATCH] inputs/ostree.checkout: don't overwrite refs The `refs` variable is used as parameter to indicate which commits to checkout, but it also was used as result variable to store the ids of the commits that actually got checked out; naturally, it was initialized to the empty array. This of course meant nothing was ever actually checked out. Doh. --- inputs/org.osbuild.ostree.checkout | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/inputs/org.osbuild.ostree.checkout b/inputs/org.osbuild.ostree.checkout index c1ffee8a..e6f7b269 100755 --- a/inputs/org.osbuild.ostree.checkout +++ b/inputs/org.osbuild.ostree.checkout @@ -82,7 +82,7 @@ class OSTreeCheckoutInput(inputs.InputService): def map(self, store, origin, refs, target, _options): - refs = [] + ids = [] if origin == "org.osbuild.pipeline": for ref, options in refs.items(): @@ -90,16 +90,16 @@ class OSTreeCheckoutInput(inputs.InputService): with open(os.path.join(source, "compose.json"), "r") as f: compose = json.load(f) commit_id = compose["ostree-commit"] - refs.append(checkout({commit_id: options}, source, target)) + ids.append(checkout({commit_id: options}, source, target)) else: source = store.source("org.osbuild.ostree") - refs = checkout(refs, source, target) + ids = checkout(refs, source, target) reply = { - "path": target, - "data": { - "refs": {ref: {"path": ref} for ref in refs} - } + "path": target, + "data": { + "refs": {i: {"path": i} for i in ids} + } } return reply