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:
parent
1d5d1fd44a
commit
4d11dbcc73
1 changed files with 12 additions and 4 deletions
|
|
@ -13,16 +13,24 @@ import sys
|
||||||
import osbuild.api
|
import osbuild.api
|
||||||
|
|
||||||
|
|
||||||
SCHEMA = """
|
SCHEMA_2 = """
|
||||||
"additionalProperties": true
|
"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))
|
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__':
|
if __name__ == '__main__':
|
||||||
args = osbuild.api.arguments()
|
args = osbuild.api.arguments()
|
||||||
r = main(args["tree"], args.get("options", {}))
|
r = main(args["tree"], args.get("inputs", {}), args.get("options", {}))
|
||||||
sys.exit(r)
|
sys.exit(r)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue