pipeline: run method takes store object not dir
Instead of passing the store directory to Pipeline.run, pass an already initialized ObjectStore object. This binds the lifetime of the store and its (temporary) objects to the run of osbuild not the run of the pipeline. This prepares re-using the stores with multiple (non-nested) pipelines.
This commit is contained in:
parent
8d2c7f8160
commit
f38c48086e
3 changed files with 38 additions and 35 deletions
|
|
@ -14,6 +14,7 @@ import sys
|
|||
import osbuild
|
||||
import osbuild.meta
|
||||
import osbuild.monitor
|
||||
from osbuild.objectstore import ObjectStore
|
||||
from osbuild.formats import v1 as fmt
|
||||
|
||||
|
||||
|
|
@ -114,12 +115,13 @@ def osbuild_cli():
|
|||
monitor = osbuild.monitor.make(monitor_name, sys.stdout.fileno())
|
||||
|
||||
try:
|
||||
r = manifest.build(
|
||||
args.store,
|
||||
monitor,
|
||||
args.libdir,
|
||||
output_directory=args.output_directory
|
||||
)
|
||||
with ObjectStore(args.store) as object_store:
|
||||
r = manifest.build(
|
||||
object_store,
|
||||
monitor,
|
||||
args.libdir,
|
||||
output_directory=args.output_directory
|
||||
)
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
print(f"{RESET}{BOLD}{RED}Aborted{RESET}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue