From 4d11dbcc73ae612934a84746f05b7c7c816aede7 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 12 Feb 2021 10:57:51 +0000 Subject: [PATCH] stages/noop: accept inputs Convert the noop stage to schema version 2 so that it can accept any sorts of inputs. This is useful for testing. --- stages/org.osbuild.noop | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/stages/org.osbuild.noop b/stages/org.osbuild.noop index eb5dfbac..4b4d1ea8 100755 --- a/stages/org.osbuild.noop +++ b/stages/org.osbuild.noop @@ -13,16 +13,24 @@ import sys import osbuild.api -SCHEMA = """ -"additionalProperties": true +SCHEMA_2 = """ +"options": { + "additionalProperties": true +}, +"inputs": { + "additionalProperties": true +} """ -def main(_tree, options): +def main(_tree, inputs, options): print("Not doing anything with these options:", json.dumps(options)) + for name, desc in inputs.items(): + print(f"Not doing anything with Input '{name}'", json.dumps(desc)) + if __name__ == '__main__': args = osbuild.api.arguments() - r = main(args["tree"], args.get("options", {})) + r = main(args["tree"], args.get("inputs", {}), args.get("options", {})) sys.exit(r)