From 3bf5d26c7a06544347236a59072ea1ddff93ce0b Mon Sep 17 00:00:00 2001 From: chloenayon Date: Tue, 25 Aug 2020 18:39:25 +0200 Subject: [PATCH] pipeline: replace objectstore logic with get call In pipeline.run, replace calls to objectstore.contains and objectstore.new with a call to objectore.get, which has the same functionality. --- osbuild/pipeline.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osbuild/pipeline.py b/osbuild/pipeline.py index 1b63b3f1..0a6047fa 100644 --- a/osbuild/pipeline.py +++ b/osbuild/pipeline.py @@ -332,11 +332,12 @@ class Pipeline: # tree exists, we return it as well, but we do not care if it is # missing, since it is not a mandatory part of the result and would # usually be needless overhead. - if object_store.contains(self.output_id): + obj = object_store.get(self.output_id) + + if obj: results = {"success": True} - if output_directory: - with object_store.new(base_id=self.output_id) as output: - output.export(output_directory) + obj.export(output_directory) + else: results, build_tree, tree = self.build_stages(object_store, monitor,