Validate manifest in plugin, fix rollback error

This commit is contained in:
Anders Ingemann 2013-07-01 20:13:07 +02:00
parent 0c1677eef2
commit 25a017fa35
2 changed files with 30 additions and 1 deletions

View file

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

View file

@ -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"]
}