diff --git a/plugins/prebootstrapped/__init__.py b/plugins/prebootstrapped/__init__.py index f77825b..ebe68eb 100644 --- a/plugins/prebootstrapped/__init__.py +++ b/plugins/prebootstrapped/__init__.py @@ -20,4 +20,10 @@ def rollback_tasks(tasklist, tasks_completed, manifest): if task in completed and counter not in completed: tasklist.add(counter()) - counter_task(ebs.CreateVolumeFromSnapshot, ebs.DeleteVolume) + counter_task(CreateVolumeFromSnapshot, ebs.DeleteVolume) + + +def validate_manifest(data, schema_validate): + from os import path + schema_path = path.normpath(path.join(path.dirname(__file__), 'manifest-schema.json')) + schema_validate(data, schema_path) diff --git a/plugins/prebootstrapped/manifest-schema.json b/plugins/prebootstrapped/manifest-schema.json new file mode 100644 index 0000000..8c853e6 --- /dev/null +++ b/plugins/prebootstrapped/manifest-schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Prebootstrapped plugin manifest", + "type": "object", + "properties": { + "plugins": { + "type": "object", + "properties": { + "prebootstrapped": { + "type": "object", + "properties": { + "snapshot": { + "type": "string" + } + }, + "required": ["snapshot"] + } + }, + "required": ["prebootstrapped"] + } + }, + "required": ["plugins"] +}