From ba6c07f4061e969b45f614526ed3ec9c1b919e56 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 20 Jan 2022 13:22:20 +0000 Subject: [PATCH] pipeline: remove build_tree return value The pipeline data model used to have an assembler optionally associated with the pipeline; therefore we had to return the build tree used to to build the stages since the same build tree also needed to be used from the assembler. In the "new" model (first introduced in version 27), the assembler got replaced by another "normal" pipeline. Since then, there is no need to return the build tree anymore. Remove it. --- osbuild/pipeline.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/osbuild/pipeline.py b/osbuild/pipeline.py index 407a0816..1682c41b 100644 --- a/osbuild/pipeline.py +++ b/osbuild/pipeline.py @@ -287,18 +287,17 @@ class Pipeline: if not build_tree: raise AssertionError(f"build tree {self.build} not found") - # If there are no stages, just return build tree we just - # obtained and a new, clean `tree` + # If there are no stages, just return a clean `tree` if not self.stages: tree = object_store.new() - return results, build_tree, tree + return results, tree # Check if the tree that we are supposed to build does # already exist. If so, short-circuit here tree = object_store.get(self.id) if tree: - return results, build_tree, tree + return results, tree # Not in the store yet, need to actually build it, but maybe # an intermediate checkpoint exists: Find the last stage that @@ -337,7 +336,7 @@ class Pipeline: if not r.success: cleanup(build_tree, tree) results["success"] = False - return results, None, None + return results, None # The content of the tree now corresponds to the stage that # was build and this can can be identified via the id of it @@ -346,7 +345,7 @@ class Pipeline: if stage.checkpoint: object_store.commit(tree, stage.id) - return results, build_tree, tree + return results, tree def run(self, store, monitor, libdir, stage_timeout=None): results = {"success": True} @@ -361,7 +360,7 @@ class Pipeline: obj = store.get(self.id) if not obj: - results, _, obj = self.build_stages(store, monitor, libdir, stage_timeout) + results, obj = self.build_stages(store, monitor, libdir, stage_timeout) if not results["success"]: return results