From 5cd139d53a62fcb9f14ef4c6c038ce44eae24557 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 12 Feb 2021 11:25:00 +0000 Subject: [PATCH] inputs: add noop input for testing Add a new "noop" input that does nothing but forward all its data to the stage. Can be useful for testing. --- inputs/org.osbuild.noop | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 inputs/org.osbuild.noop diff --git a/inputs/org.osbuild.noop b/inputs/org.osbuild.noop new file mode 100755 index 00000000..84bb7f2b --- /dev/null +++ b/inputs/org.osbuild.noop @@ -0,0 +1,35 @@ +#!/usr/bin/python3 +""" +No-op inputs + +Does nothing with the supplied data but just forwards +it to the stage. +""" + + +import json +import sys + +from osbuild.objectstore import StoreClient + + +SCHEMA = """ +"additionalProperties": true +""" + + +def main(): + args = json.load(sys.stdin) + refs = args["refs"] + + store = StoreClient(connect_to=args["api"]["store"]) + + path = store.mkdtemp(prefix="empty") + data = {"path": path, "data": {"refs": refs}} + json.dump(data, sys.stdout) + return 0 + + +if __name__ == '__main__': + r = main() + sys.exit(r)