osbuild.py: clean up Pipeline API
Separate deserialization into a new `osbuid.load()` function. Pass objects to `Pipeline.run()` instead of keeping it in an attribute on the pipeline.
This commit is contained in:
parent
36f20b3e48
commit
baa5da6abe
2 changed files with 36 additions and 24 deletions
5
osbuild
5
osbuild
|
|
@ -26,11 +26,10 @@ if __name__ == "__main__":
|
|||
args = parser.parse_args()
|
||||
|
||||
with open(args.pipeline_path) as f:
|
||||
pipeline = json.load(f)
|
||||
pipeline = osbuild.Pipeline(pipeline, args.objects)
|
||||
pipeline = osbuild.load(json.load(f))
|
||||
|
||||
try:
|
||||
pipeline.run(args.output_dir, interactive=True)
|
||||
pipeline.run(args.output_dir, args.objects, interactive=True)
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
print(f"{RESET}{BOLD}{RED}Aborted{RESET}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue