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.
This commit is contained in:
Christian Kellner 2021-02-12 10:57:51 +00:00
parent 1d5d1fd44a
commit 4d11dbcc73

View file

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