pipeline: only copy output if there is any

Make sure to verify that the pipeline actually produced any output
before attempting to copy it out. This fixes osbuild running with
`--output-directory` but without assembler.
This commit is contained in:
David Rheinsberg 2020-05-20 10:44:51 +02:00
parent 1896047bae
commit 9dfa0e8a61

View file

@ -362,7 +362,7 @@ class Pipeline:
results.update(r) # This will also update 'success'
if results["success"] and output_directory is not None:
if results["success"] and output_directory and "output_id" in results:
output_source = object_store.resolve_ref(results["output_id"])
if output_source is not None:
subprocess.run(["cp", "--reflink=auto", "-a", f"{output_source}/.", output_directory], check=True)