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:
Lars Karlitski 2019-07-15 20:28:23 +02:00 committed by Tom Gundersen
parent 36f20b3e48
commit baa5da6abe
2 changed files with 36 additions and 24 deletions

View file

@ -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}")