mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Validate manifest in plugin, fix rollback error
This commit is contained in:
parent
0c1677eef2
commit
25a017fa35
2 changed files with 30 additions and 1 deletions
|
@ -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)
|
||||
|
|
23
plugins/prebootstrapped/manifest-schema.json
Normal file
23
plugins/prebootstrapped/manifest-schema.json
Normal 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"]
|
||||
}
|
Loading…
Add table
Reference in a new issue