From d57eeb38b99de95ca08776245bd0fa7274278368 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 8 Feb 2022 10:24:40 +0100 Subject: [PATCH] Pass source-epoch to stages only if set The client side does meta.get("source-epoch", default), but for this to work we need to have the key unset if not specified, but currently we set it to None. Also, make sure the check for "not None" is explicit, because we do consider a value of `0` to be a valid source-epoch. --- osbuild/pipeline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osbuild/pipeline.py b/osbuild/pipeline.py index 5bee5b26..4bcc30f3 100644 --- a/osbuild/pipeline.py +++ b/osbuild/pipeline.py @@ -96,11 +96,13 @@ class Stage: def prepare_arguments(self, args, location): args["options"] = self.options - args["meta"] = { + args["meta"] = meta = { "id": self.id, - "source-epoch": self.source_epoch } + if self.source_epoch is not None: + meta["source-epoch"] = self.source_epoch + # Root relative paths: since paths are different on the # host and in the container they need to be mapped to # their path within the container. For all items that