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.
This commit is contained in:
parent
4d11dbcc73
commit
5cd139d53a
1 changed files with 35 additions and 0 deletions
35
inputs/org.osbuild.noop
Executable file
35
inputs/org.osbuild.noop
Executable file
|
|
@ -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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue